A VM in Java with tail-calls and continuations

Wednesday, August 31, 2005

The “last” release - 0.4

Hi all!

That's right, this is it: the last modifications for the Google Summer of Code are in. From now on, and I still have until tomorrow, it'll be just writing API documentation (javadocs for the “public” classes) and bugs' squashing.

So, are you curious about what got in, and what not?

It pretty much covers everything on the initial proposal. A few things didn't make it though.

This version introduces the serialization of continuations. I've also moved the Ambivalence class to a “new” util package. This package will host classes implementing common uses of continuations. I've also added the Generator class, an implementation of generators, much like Python's.

And now, on to what doesn't work...

Synchronization doesn't work, as I've explained before. Since then I've found that this behavior (enforcing balanced locking) is optionally mandated by the JVM Spec, so some VMs may not even enforce it. Besides that, Sun VMs (which do enforce it) have ways to bypass it through sun.misc.Unsafe. So, there is hope.

Method invocations with the super keyword don't work either. In general invokespecial can only be used to call either private methods or constructors in interpreted code. All other uses are disallowed by the interpreter. This is so because it is not possible to call such methods through reflection: the overriding method is always called. I have currently no solution for this issue.

Winding protection (which was not part of the initial proposal, but had been promised afterwards) was not implemented. The problem is that continuing blocks could not be implemented that way, since executing them would destructively modify their frame. Winding guards will be implemented sometime in the future in an alternative way, but designing the solution will take its time, since the way we do this affects our synchronization policy as well.

Besides this three outstanding issues, everything should work - and I'd like to ear about it if it doesn't.

That does not however mean my work is anywhere near finished. There are options to work around those issues, and a lot can still be done in terms of performance. Work will continue and feedback is welcomed.

I'll be making another release tomorrow, either a 1.0 or something like a 1.0b1 (with which I'd be more confortable, as long as it doesn't clash with Google's goals, since the code has barely been tested).

No comments:

Archive