Standard ML of New Jersey
|Paradigm||Multi-paradigm: functional, imperative|
110.95 / November 9, 2019
|Typing discipline||strong, static, inferred|
Standard ML of New Jersey (SML/NJ; Standard Meta-Language of New Jersey) is a free and open-source compiler and programming environment for the Standard ML programming language. Aside from its runtime system, which is written in C, SML/NJ is written in Standard ML. It was originally developed jointly by Bell Laboratories and Princeton University.
SML/NJ extends the SML'97 Basis Library with several additional top-level structures:
- System info – the
SysInfostructure provides information about the runtime system, such as the operating system kind, type and version and whether or not the machine supports multiprocessing.
- Weak pointers – the
Weakstructure provides support for weak pointers.
- Lazy suspensions – the
Suspstructure implements the suspensions necessary for lazy evaluation (as opposed to eager evaluation).
- Compiler internals – the
Internalsstructure provides access to several of the compiler internals, including methods to instantiate and modify the signal table.
- Unsafe access – the
Unsafestructure provides unsafe access to data structures and runtime-system functions.
- Visible compiler structures – SML/NJ also includes structures that provide access to the ML compiler, which contains substructures for execution profiling, control of compiler error-message printing and warnings, and customizable pretty printing.
Additionally, SML/NJ provides some syntactic constructs that are not standard features of SML'97:
- Vector expressions and patterns – SML/NJ allows the creation of vectors with the
#[exp0, exp1, ..., expn−1]syntax and allows pattern-matching on them with analogous syntax.
- Or-patterns – SML/NJ extends the syntax of SML'97 patterns to allow for a matching multiple patterns in a single rule, provided each pattern has the same type, using
(apat1 | ... | apatn) => exp.
- Object language embedding – SML/NJ provides the quote/antiquote syntax that permits the embedding of expressions in an object language's concrete syntax within ML expressions and programs.
- Higher-order modules – SML/NJ supports the parametrization of functors by allowing functors to be components of structures, in addition to Standard ML's parametric modules in the form of functors.
Successor ML Features
With the 110.81 release, the evolution of SML/NJ is geared towards evolving the Standard ML Basis library and supporting Successor ML features.
In the current release, the Successor ML features can be enabled using the command-line option
The Successor ML documents have been extracted from the SML/NJ '97 TeX files and made available as a GitHub repository of TeX documents which the community is expected to collaborate and grow the language.
In addition, HaMLet has a complete implementation of Successor ML features. The practical knowledge so gained, is being incorporated in SML/NJ as it evolves through its releases.
- "Standard ML of New Jersey Change Log". www.smlnj.org.
- "Standard ML of New Jersey License". www.smlnj.org.
- "SML/NJ background information". www.smlnj.org. Retrieved 2018-09-05.
- "SML/NJ Special Features". www.smlnj.org. Retrieved 2018-09-05.
- "The SYS_INFO signature". www.smlnj.org. Retrieved 2018-09-05.
- "The WEAK signature". www.smlnj.org. Retrieved 2018-09-05.
- "The SUSP signature". www.smlnj.org. Retrieved 2018-09-05.
- "The INTERNALS signature". www.smlnj.org. Retrieved 2018-09-05.
- "The Unsafe structure". www.smlnj.org. Retrieved 2018-09-05.
- "The Visible Compiler". www.smlnj.org. Retrieved 2018-09-05.
- "SML/NJ Quote/Antiquote". www.smlnj.org. Retrieved 2018-09-05.