Standard ML of New Jersey User's Guide

Standard ML of New Jersey (SML/NJ) is a compiler, interactive system, and programming environment for the Standard ML language. This document is a guide to programming in Standard ML using SML/NJ.

General Information

Several very useful books on the Standard ML programming language are available, and a number of Standard ML tutorials can be found on line. The and comp.lang.functional newsgroups are also a good source of information, help, and news, and these newsgroups maintain associated FAQs. Our literature page summaries these general information sources.

Using Standard ML of New Jersey

Obtaining the SML/NJ Software
SML/NJ is available for free via internet ftp or the web. It's use is governed by a very liberal license.
Installing SML/NJ
Installing SML/NJ under under Unix is easy, and generally just requires downloading the files and running a shell script. Installation under Windows is even easier using the self-installing ".exe" file.
A FAQ for SML/NJ is currently under development but is still very fragmentary.
The SML/NJ Interactive System
How to get started with sml, how to compile and run programs.
Compilation Manager
The SML/NJ compilation manager CM organizes and optimizes the compilation process. CM calculates and caches the dependence graph between modules. When a module has been edited and is recompiled, CM compares the export type-signature of the new module to that of the old, to minimize the number of modules that are recompiled. The CM Manual is also available in Postscript.
SML/NJ Error Messages
An explanation of the error messages printed by the SML/NJ compiler.
Special features of SML/NJ
Standard ML of New Jersey supports some extensions to the Standard ML language, such as first-class continuations, higher-order functors, and so on.
The SMLofNJ structure
This structure contains runtime-system interface and operating-system interface functions that are not part of the international standard.
The Compiler structure
This structure contains user-settable flags to control the operation of the compiler and interactive system, and also interfaces to individual phases of the SML/NJ compiler.
SML '97 Conversion Guide
The Standard ML '97 language is almost, but not quite, compatible with the 1990 definition supported by earlier versions of SML/NJ; the conversion guide explains the differents, and gives examples of how to upgrade existing SML'90 programs.
Top Level Environment Comparison
A comparison of the SML/NJ 0.93 and SML/NJ 110 top level environments.

Basic Libraries

The Standard ML Basis Library
This describes the "library" functions and interfaces that are part of the ML standard. This includes modules for I/O, operating-system interface, arithmetic on integers, reals, and words (unsigned integers), mathematical functions, operations on strings and substrings, and so on.
The Standard ML of New Jersey Library
The SML/NJ Library contains library and utility functions that are not part of the standard Standard. The SML/NJ library includes modules for binary search trees, adjustable arrays, and other useful data structures in the Util directory. The Unix directory supplies additional Unix-specific features, while the HTML directory supports processing web pages.

Programming Tools and Libraries

A lexical-analyzer generator similar to the classic Unix lex.
A parser generator similar to the classic Unix yacc, but with syntax error repair features.
Concurrent ML
A library adding concurrency to SML.
An X-windows based graphical interface toolkit.
SML/NJ C Interface Library
Lorenz Huelsbergen's library for building SML interfaces to C libraries and programs.
The SML/NJ compiler uses Lal George's MLRISC code generation framework (currently for Alpha and HPPA architectures, but eventually for all architectures). MLRISC is being developed as an independent tool for building highly modular optimizing code generators, and is currently being used in a number of other compilers and compiler research projects.

Emacs Editing and Interaction Support

Documentation for version 3.3 of Matthew J. Morley's sml-mode for Gnu emacs and Xemacs, which supports editing SML source code and interacting with sml under emacs. Sml-mode is now maintained by Stefan Monnier (monnier at iro dot umontreal dot ca), and the latest version is available at

| SML/NJ Home page |

Send your comments to .
Copyright © 2017, SML/NJ Fellowship.