Moscow SML: A compact Core Standard ML implementation

Peter Sestoft <>
Fri, 2 Sep 1994 08:02:40 GMT

          From comp.compilers

Related articles
Moscow SML: A compact Core Standard ML implementation (Peter Sestoft) (1994-09-02)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Peter Sestoft <>
Keywords: ML, functional, available
Organization: Compilers Central
Date: Fri, 2 Sep 1994 08:02:40 GMT

Standard ML is a strict functional language, widely used in research
and increasingly used in teaching, sometimes even as a first language.

Moscow SML provides a light-weight implementation of the Standard ML
Core language, suitable for use on personal computers.

Moscow SML is particularly suitable for teaching and experimentation,
where fast compilation and modest storage consumption are more
important than fast program execution.

* Thanks to the efficient run-time system of Caml Light, Moscow SML
    compiles fast and uses little memory. Typically it uses 5-10 times
    less memory than SML/NJ and 2-3 times less than Edinburgh ML. Yet the
    bytecode is only 3 to 10 times slower than SML/NJ 0.93 compiled native
    code (fast on PCs, slower on RISCs).

* Thanks to guidance from the ML Kit model implementation, Moscow SML
    is true to the Definition of Standard ML (Milner,Tofte,Harper 1990).

* Thanks to the djgpp/go32 DOS extender, Moscow SML runs efficiently
    under MS DOS and MS Windows on PCs.

In principle, it can be compiled on any platform supported by Caml
Light. So far we have tried Intel386-based PCs running DOS or Windows
or Linux, DEC MIPS running Ultrix, and DEC Alpha running OSF/1.


Moscow SML requires a 386 or 486 PC with 2 MB of RAM or more, and DOS
3.3 or later. The installation requires around 360 KB disk space.


The current version 1.00 of Moscow SML
        * implements the entire Standard ML Core language
        * does not implement modules (signatures, structures, functors)
        * does not raise arithmetic exceptions properly


We measured the time and space consumption for compiling a 780-line
Core ML version of Larry Paulson's proofchecker "Hal" (see Paulson: ML
for the Working Programmer, Cambridge University Press, 1992).

SML/NJ 0.93 8360 7284 0:40 ) DECstation 5200 (MIPS)
Edinburgh ML 4.1 2528 2020 0:19 ) with 48 MB RAM
Moscow SML 1.00 876 796 0:13 ) running Ultrix

SML/NJ 0.93 10265 7272 1:01 ) 486DX/33 with 16 MB RAM
Moscow SML 1.00 813 836 0:11 ) running Linux 1.0

SZ is the amount of virtual memory in KB, RSS is the amount of in-core
memory in KB, TIME is the cpu+system time spent on compilation. Note
that the figures indicate *compilation* time, not the speed of the
compiled programs. However, the bytecode of Caml Light, and hence of
Moscow SML, appears to make good use of the Intel processors (which
have no alignment constraints).


A testsuite for the Core static semantics found three errors in a
preliminary version of Moscow SML. These have been corrected in
version 1.00. The testsuite was developed systematically (from the
Definition of Standard ML) by Sten Schmidt and Michael Vium in a
student project at the Technical University of Denmark. The test
suite is available as

Running the 177 Core-related test cases from the SML/NJ test suite
found three more errors; these have been corrected as well.


It is the intention, sooner or later,

        * to add a simple separate compilation system a` la Caml Light (sooner);
        * to implement the Standard ML module language (later).


Moscow SML was written by
        Sergei Romanenko (
        Keldysh Institute of Applied Mathematics, Russian Academy of Sciences
        Miusskaya Pl. 4, 125047 Moscow, Russia.

Scientific and practical assistance was provided by
        Peter Sestoft (, Technical University of Denmark.

Moscow SML is based on, and would not exist without:
        * the CAML Light 0.6 implementation by Xavier Leroy and Damien Doligez
            (INRIA, Rocquencourt, France);
        * the ML Kit by Lars Birkedal, Nick Rothwell, Mads Tofte and David Turner
            (Copenhagen University, Denmark, and Edinburgh University, Scotland);
        * djgpp and the go32 DOS extender by D.J. Delorie (Rochester, NH, USA).


        * The DOS/Windows executables are in
        * The source files are in

You will need Caml Light 0.6 and gcc to compile Moscow SML for Unix.

You will need Caml Light 0.6, djgpp, perl, and Borland C++ version 2.0
(or later) to recompile Moscow SML for DOS:
        * Caml Light can be obtained from
        * Djgpp and go32 can be obtained from

Peter Sestoft * * Department of Computer Science
Technical University of Denmark, Building 344 DK-2800 Lyngby, Denmark
Tel: +45 45 93 33 32 * Direct: +45 45 93 12 22/3749 * Fax: +45 42 88 45 30

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.