Status, end of January

As mentioned in my christmas status I’m currently revisiting some of the more short-sighted decisions I made in the design of the implementation. I’m not quite there yet but I’m getting close.

I’ve already replaced the binary object format. That was step one.

Step two was to change the model for mutable state to match the new model which I’ve described partially in the post about constructors, and which I’ll expand on in a future blogpost I’m almost done with. That turned out to actually be a relatively small change, which is now also done.

The third step is the biggest one, but the one that initiated the whole reimplementation: changing from a bytecode-based intermediate representation to one that is AST based. I originally used combined bytecode/syntax-tree approach but it turned out to be too difficult to work with and in particular too difficult to transform. I’ve taken a gradual approach to reimplementing this, keeping the old format but gradually replacing more and more with the new approach. At this point I only have one construct left to implement, then the Java implementation of neutrino can stop using the old format completely. I’m so looking forward to getting rid of the code that implements the old format and just finally being able to do a complete spring cleaning of the Java compiler.

Along the way I decided that, since the “continuation” captured by a with_1cc can’t properly be said to be a one-shot continuation, with_escape would be a better name. All you’re doing is setting up a way to escape execution of an expression, the construct might as well say that directly.

One interesting thing I’ve noticed during this is the fact that while I change everything: the language syntax, parts of the semantics, the file formats and large parts of the implementation, one thing never changes: the tests. The text of the tests sometimes change as the language changes, but their effects and the fact that they all pass stays the same. I find that interesting and it underscores the fact that the bedrock on which everything else builds are those tests.

Leave a Reply

Your email address will not be published. Required fields are marked *


*