I was a co-author of the MLj compiler that targeted the Java Virtual Machine.
I now work on the SML.NET compiler, which targets the .NET Common Language
Runtime, provides seamless interoperability with .NET libraries, and is
integrated into the Visual Studio development environment.

Publications

We present a series of CPS-based intermediate languages suitable for
functional language compilation, arguing that they have practical
benefits over direct-style languages based on A-normal form (ANF) or
monads. Inlining of functions demonstrates the benefits most clearly:
in ANF-based languages, inlining involves a re-normalization step that
rearranges let expressions and possibly introduces a new `join point'
function, and in monadic languages, commuting conversions must be
applied; in contrast, inlining in our CPS language is a simple
substitution of variables for variables.

We present a contification transformation implemented by simple
rewrites on the intermediate language. Exceptions are modelled using
so-called `double-barrelled' CPS. Subtyping on exception constructors
then gives a very straightforward effect analysis for exceptions. We
also show how a graph-based representation of CPS terms can be
implemented extremely efficiently, with linear-time term
simplification.

One performance-critical phase in the SML.NET compiler involves rewriting
intermediate terms to monadic normal form and performing non-duplicating
β-reductions. We present an imperative algorithm for
this simplification phase, working with a mutable, pointer-based term
representation, which significantly outperforms our existing functional
algorithm. This is the first implementation and evaluation of a linear-time
rewriting algorithm proposed by Appel and Jim.

SML.NET is a compiler for Standard ML that targets the Common Language
Runtime and is integrated into the Visual Studio development environment. It
supports easy interoperability with other .NET languages via a number of
language extensions, which go considerably beyond those of our earlier compiler,
MLj.

This paper describes the new language extensions and the features of the Visual
Studio plugin, including syntax highlighting, Intellisense, continuous type
inference and debugger support. We discuss our experiences using SML.NET to
write SML programs that interoperate with other .NET languages, libraries and
frameworks. Examples include the Visual Studio plugin itself (written in SML.NET,
using .NET's COM interop features to integrate in a C++ application) and writing
ASP.NET and Pocket PC applications in SML.

From the points of view of programming pragmatics, rewriting and operational
semantics, the syntactic construct used for exception handling in ML-like
programming languages, and in much theoretical work on exceptions, has subtly
undesirable features. We propose and discuss a more well-behaved construct.

A good foreign-language interface is crucial for the success of any
modern programming language implementation. Although all serious
compilers for functional languages have some facility for
interlanguage working, these are often
limited and awkward to use.

This article describes the features for bidirectional
interlanguage working with Java that are built into the latest version
of the MLj compiler. Because the MLj foreign interface is to
another high-level typed language which shares a garbage collector
with compiled ML code, and because we are willing to extend the ML
language, we are able to provide unusually powerful, safe and easy to
use interlanguage working features. Indeed, rather then being a
traditional foreign interface, our language extensions are more
a partial integration of Java features into SML.

We describe this integration of Standard ML and Java, first informally with
example program fragments, and then formally in the notation used by
The Definition of Standard ML.

Compiling Standard ML to Java Bytecodes
Nick Benton, Andrew Kennedy, and George Russell.
In Proceedings of the 3rd ACM SIGPLAN International Conference
on Functional Programming, Baltimore, Maryland, USA, September 1998.

MLJ compiles SML'97 into verifier-compliant Java bytecodes.
Its features include
type-checked interlanguage working extensions which allow ML and Java
code to call each other, automatic recompilation management, compact
compiled code and runtime performance which, using a `just in time'
compiling Java virtual machine, usually exceeds that of
existing specialised bytecode interpreters for ML. Notable features of
the compiler itself include whole-program optimisation based on
rewriting, compilation of polymorphism by specialisation,
a novel monadic intermediate language which expresses
effect information in the type system and some interesting data
representation choices.