Standard ML of New Jersey

From HandWiki
Revision as of 20:09, 6 March 2023 by S.Timg (talk | contribs) (simplify)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Standard ML of New Jersey
ParadigmMulti-paradigm: functional, imperative
Typing disciplinestrong, static, inferred
LicenseBSD-like license[1]
Filename extensions.sml
Websitewww.smlnj.org
Influenced by
Standard ML
Influenced
Mythryl

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.[2]

Its name is a reference both to the American state of New Jersey in which Princeton and Bell Labs are located and to Standard Oil of New Jersey, the famous oil monopoly of the early 20th century.

Features

SML/NJ extends the SML'97 Basis Library with several additional top-level structures:[3]

  • System info – the SysInfo structure provides information about the runtime system, such as the operating system kind, type and version and whether or not the machine supports multiprocessing.[4]
  • Weak pointers – the Weak structure provides support for weak pointers.[5]
  • Lazy suspensions – the Susp structure implements the suspensions necessary for lazy evaluation (as opposed to eager evaluation).[6]
  • Compiler internals – the Internals structure provides access to several of the compiler internals, including methods to instantiate and modify the signal table.[7]
  • Unsafe access – the Unsafe structure provides unsafe access to data structures and runtime-system functions.[8]
  • 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.[9]

Additionally, SML/NJ provides some syntactic constructs that are not standard features of SML'97:[3]

  • 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.[10]
  • 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.

Development

Successor ML is a term used to describe the next version of the language. The documents describing it have been extracted from the SML/NJ '97 files and made available as a GitHub repository of TeX documents which the community is expected to collaborate and grow the language.[11] Successor ML features can be enabled using the command-line option -Cparser.succ-ml=true.[12]

Since at least 1998,[13] MLton[14] is the standard bootstrapping compiler, and it has some[15] support for Successor ML.

In 2008, work began on HaMLet,[16] a reference implementation of Successor ML written entirely in Standard ML.[17] As of 2018, HaMLet remains the only complete implementation of Successor ML, with additional novelties.[15]

Since 2015,[18] the evolution of SML/NJ geared towards evolving the Basis library[19] and adding support for the Successor ML definition with the release of version 110.79.[12]

At the end of 2020, 64-bit support was added with the release of version 110.99.[18]

See also

External links

References

  1. "Standard ML of New Jersey License". http://www.smlnj.org/license.html. 
  2. "SML/NJ background information". https://www.smlnj.org/smlnj.html. 
  3. 3.0 3.1 "SML/NJ Special Features". https://www.smlnj.org/doc/features.html. 
  4. "The SYS_INFO signature". https://www.smlnj.org/doc/SMLofNJ/pages/sysinfo.html. 
  5. "The WEAK signature". https://www.smlnj.org/doc/SMLofNJ/pages/weak.html. 
  6. "The SUSP signature". https://www.smlnj.org/doc/SMLofNJ/pages/susp.html. 
  7. "The INTERNALS signature". https://www.smlnj.org/doc/SMLofNJ/pages/internals.html. 
  8. "The Unsafe structure". https://www.smlnj.org/doc/SMLofNJ/pages/unsafe.html. 
  9. "The Visible Compiler". https://www.smlnj.org/doc/Compiler/pages/compiler.html. 
  10. "SML/NJ Quote/Antiquote". https://www.smlnj.org/doc/quote.html. 
  11. "Successor ML Definition". https://github.com/SMLFamily/Successor-ML. 
  12. 12.0 12.1 "Standard ML of New Jersey version 110.79 NEWS". 2015-10-04. http://smlnj.org/dist/working/110.79/110.79-README.html. 
  13. "MLton 1999-03-19 change notes". https://github.com/MLton/mlton/blob/master/CHANGELOG.adoc#version-19990319. 
  14. "The MLton repository". https://github.com/MLton/mlton. 
  15. 15.0 15.1 "Three implementation efforts to support Successor ML". https://github.com/SMLFamily/Successor-ML#implementation-efforts. 
  16. Andreas Rossberg. "HaMLet S: To Become Or Not To Become Successor ML". https://people.mpi-sws.org/~rossberg/hamlet/hamlet-succ-1.3.1S5.pdf. 
  17. "SML reference interpreter". https://github.com/rossberg/hamlet. 
  18. 18.0 18.1 "Standard ML of New Jersey Change Log for v110.99". https://smlnj.org/dist/working/110.99/HISTORY.html. 
  19. "The Standard ML Basis Library". https://smlfamily.github.io/Basis/.