A VM in Java with tail-calls and continuations

Tuesday, August 16, 2005

The first alpha release - 0.1

Following up on my last post, yesterday I made the project's first file release - alpha version 0.1, see the downloads page.

Now the code is most likely buggy, but at least (and modulo the unknown bugs) it already does a few things:

  • it is able to interpret just about everything apart from throwing and catching exceptions
  • and, most notably, it already does tail-calls optimization.

I've also added couple of tests where added and an ant target was created (test). To test the JauVM yourself download the file (jauvm-0.1-src.tgz) and do the following:
tar xfz jauvm-0.1-src.tgz
cd jauvm
ant test
Notes: you'll need a recent version of ant (mine is 1.6.2) and a 1.5 JDK (mine is 1.5.0_02); and, there will be some warnings about missing serialVersionUIDs.

The expected output should be amongst ant's own output and is something like:
[echo] ========== Fib ==========
[java] fib(25)=121393, O(N)
[java] fib(25)=121393, O(log(N))
[java] fib(25)=121393, O(exp(N))
[echo] ========= Parity ========
[java] even(65536)?=true
[java] odd(65536)?=false
[java] even(65535)?=false
[java] odd(65535)?=true
[echo] =========================

The sources for these tests are under the test directory, do take a look.

The interpreter is pretty slow and memory hungry right now, but there's a lot of room for improvement though that's not a priority - features and correct behaviour come first.

The only known issues (that are not easy problems) are synchronization (as I've said earlier) and some method invocations, like those with the super keyword (calling virtual methods of the super-class). Other known issues have to do with class garbage collection, but seem more manageable.

Under memory pressure the interpreter may throw a NullPointerException - this is being worked on. Other than that, all bug reports are welcomed.

Work will continue on implementing exceptions throwing and handling. That's it for today!

No comments: