Cell-to-C# compiler initial release

The first release of the Cell-to-C# compiler/code generator is out today. It is provided as a .NET application, and even though it was developed using Mono on Linux, it should work just fine on Windows, though I haven't actually tried it there yet.

The interface of the generated code is documented in the Interfacing with C# chapter. Other details can be found in the Getting started chapter.

All language features are exactly the same as in the C++ version, but the Cell to C# compiler has a couple of improvements. First of all, the interface of the generated code is quite a bit nicer. The names of the methods of the generated classes are very similar to what you would see in hand-written code, unless there's some naming conflict that forces the compiler to add prefixes and/or underscores. More importantly, the mapping between the Cell data types and the native C# types works better here, both because mapping to C# data structures is intrinsically easier, and because there have been improvements to the mapping itself, which will of course be soon backported to the C++ code generator as well. The new mapping doesn't take full advantage of all the available C# features, though. In particular, it's not making use yet of named tuples, which can be used to straightforwardly map Cell records. That will be fixed soon.

The other major improvement is in the data structures that are used in the physical implementation of mutable relations, which are now much closer to their final form. All lookups and searches are now performed in constant time (of course if a search returns more than one result, retrieving each additional result required an additional small constant time).

The bad news is that (apart from the aforementioned case of operations on mutable relations) the generated C# code is a lot slower than the generated C++. The Cell compiler, which is itself written in Cell and is the only real benchmark I have at the moment, runs an order of magnitude slower when compiled to C# instead of C++. All the low level optimizations that worked well with C++ only seemed to make things worse here, so I gave up on that after a couple of days. I could have tried harder, but since I'm going to start working very soon on type-based optimization, which is where the real speed gains should come from (and which will work across all target languages), there was no point in investing more time and effort in that. Whatever optimization I can add at this stage, it will probably became useless once type-based optimization is implemented.

Along with this release I've also added a new hands-on introduction/tutorial and a comparison with OOP.

Next up is the Java version of the compiler/code generator. It's going to be very similar to the C# version released today, so it should be ready pretty soon, in just a few weeks.