Standard ML (often abbreviated SML) is a general-purpose, statically typed functional programming language in the ML family. It emphasizes expressiveness and safety through a strong type system with automatic type inference. SML programs are written in a concise, declarative style that supports higher-order functions, pattern matching and algebraic data types.
Key characteristics
- Static, strong typing with Hindley–Milner style type inference and parametric polymorphism.
- Algebraic data types and exhaustive pattern matching for clear, declarative data manipulation.
- A module system built from structures, signatures and functors that supports abstraction and separate compilation.
- Strict (eager) evaluation semantics, garbage collection, exceptions and mutable references for pragmatic programming.
- Language rules like the "value restriction" govern interactions between polymorphism and side effects.
The combination of a powerful, formally defined type system and a practical runtime makes SML suitable for writing robust systems software while remaining amenable to formal reasoning.
Origins and development
SML grew out of the original ML language developed in the context of the Edinburgh LCF project; key contributors include Robin Milner and colleagues. Over time the community converged on a standardized dialect. A formal Definition of Standard ML was published to specify syntax and static semantics precisely, and to serve as a reference for implementations and research.
Uses and implementations
Standard ML has been used extensively in academic settings, in programming-language research, and for tool building. It is a common choice for writing compilers and for parts of interactive theorem provers and proof assistants (for example the HOL family). Popular implementations include SML/NJ, MLton and Moscow ML; these differ in performance, compilation strategy and platform support.
Compared with other ML-family languages such as OCaml, Standard ML is notable for its clean, formally specified semantics and its influential module system. Its design has shaped subsequent functional languages and continues to be taught and used where strong static guarantees and modular abstraction are important.