Cell compiler version 0.5.4

Version 0.5.4 of the Java and C# code generators are now available. Apart from a number of bug fixes, they bring some syntactic changes, a more efficient way to load and save the state of relational automata, and major improvements to the interface of the generated classes when compiling to C#.

The instructions used to send messages to relational automata and to set and make a copy of their states have been replaced with builtin procedures. Instead of writing:

// Sending a message to an automaton
success = instance <- message;

// Making a copy of the automaton state
state_copy = read instance;

// Setting the state of an automaton
success = write instance <- new_state;

you'll now have to write:

// Sending a message to an automaton
success = Send(instance, message);

// Making a copy of the automaton state
state_copy = Copy(instance);

// Setting the state of an automaton
success = Set(instance, new_state);

The old syntax was admittedly pretty weird, while the new one is more uniform and easy to remember. There are also new procedures for directly loading and storing the state of an automaton instance from and to a file:

// Loading the state of instance from state.txt
success = Load(instance, "state.txt");

// Saving the state of instance to state.txt
success = Save(instance, "state.txt");

It was already possible to do this of course, but the old way of doing it was not only slower but it required a lot more memory, which caused it to fail when dealing with very large datasets. These functionalities were already available in embedded mode (through load(..)/save(..) in Java and Load(..)/Save(..) in C#) but now they can be used also in programs written entirely in Cell.

By far the most important new feature of this release is a complete redesign of the interface of the C# classes generated for use in embedded mode. You can read the details here. From the beginning one of the main goals of Cell was to make those generated classes almost as easy to use as hand-written ones. The design of their interface went through several iterations, none of which was particularly satisfactory until now, but this release comes, I believe, reasonably close to that goal, and it's the first one I'm moderately satisfied with.

Unfortunately, it's also heavily dependent on a number of C# features (tuples and named tuples in particular, but also partial classes and named and optional arguments) that are not available in Java, so this new design cannot be ported as it is to the Java code generator. The plan is to also improve the interface of the generated Java classes in a future release of course, but there are many details that still need to be figured out, so that will have to wait a bit longer.

Finally this release adds a bunch of new sorting functions to the standard library, which are documented here.