mljvm


MLJVM: A Java Virtual Machine implemented in Standard ML


This project is to develop a virtual machine interpreter for a subset of Java bytecode. The interpreter is to be implemented in the impure functional language Standard ML.
Java programs are compiled to a portable bytecode called JVML (the Java Virtual Machine Language). JVML programs are executed on a virtual machine (the JVM). There are two types of virtual machines; bytecode interpreters and just-in-time compilers. This project is concerned solely with the first kind of JVM.
Java Virtual Machines are usually implemented in C or variants of Java. Implementing a JVM in a high-level, mostly functional language such as Standard ML offers the possibility of implementing some aspects of the JVM using those features which are only offered by a functional language. These include using functions as values and utilising unique control-flow mechanisms such as call/cc. In addition, the program can be structured very differently from a traditional JVM, using SML's functors or the higher-order module system of Moscow ML.
Implementing all of Java bytecode is beyond the scope of this project and it is not anticipated that any support for concurrency will be provided. However, the completed JVM should certainly be much more than a toy. It should be possible to execute Grail class files on this JVM. (Grail is a substantial subset of JVML: see the references below.)


Documentation

The MLJVM has been implemented by Laura Korte and is documented in her MSc thesis, ``MLJVM: A Java Virtual Machine implemented in Standard ML'', University of Edinburgh, 2003.


Download

Download the project source code and documentation (Version of October 3rd 2003, ZIP archive).


References


Page maintained by Stephen Gilmore
Last modified: Fri Oct 3 15:06:51 BST 2003