MLj is a compiler for Standard ML which compiles to Java bytecodes. It was originally developed by Nick Benton, Andrew Kennedy and George Russell of Persimmon IT, Inc's Cambidge research group and is now available from the MLj home page, which is managed by Ian Stark at the University of Edinburgh.
The MLj compiler has been, as Ian puts it, "rather stable" for many years. The successor of MLj was SML.NET, but F# has the functional .NET market pretty sewn up these days.
Features of MLj 0.2 include:
- conformance to a subset of SML '97, approximately everything except for functors;
- implementation of a large subset of the SML Basis Library;
- typed-checked interlanguage working extensions for interfacing existing Java classes and for implementing new classes with methods written in SML;
- automatic recompilation management;
- whole-program optimisation to produce compact compiled code with good runtime performance.
Here's a screenshot of the snazzy multimedia (3D animation and MIDI music) demo which Andrew and I put together for our talk at ICFP'99:
The program (entirely in MLj) solves the classic 8-Queens problem, finding the 92 ways of placing eight queens on a chessboard so that none of them threatens another. It then shows each solution in turn, animating the transitions between them (this involves a further search to find legal, interesting ways of moving between the solutions in which no queens collide). The animated 3D display uses the Java3D libraries, with the pieces' geometry loaded from a VRML file created in a 3D modelling package. As the queens perform their little dance, the Java MIDI libraries are used to play Ravel's Bolero from a score assembled using a collection of functional music combinators.