Standard ML of New Jersey
Release Notes

Version 2024.1
May 17, 2024


This patch release incorporates a large number of bug fixes and improvements from the "legacy" version , including implementing some missing features from the Standard ML Basis Library and improvements to the SML/NJ Library.



  • The system/cmb-make script now runs with the CM_VERBOSE environment variable set to false by default (use the -verbose option for the old behavior). It also now sets the PATH environment variable to include the directory where the sml command lives when it is given as an argument to cmb-make.

Basis Library

  • Complete rewrite of the mechanisms used to implement conversions between strings and reals. As part of this rewrite, we implemented the support for the StringCvt.EXACT formatting mode and implemented the missing Real.toDecimal/fromDecimal functions. The real-string conversions is based on the Ryu library and associated PLDI paper by Ulf Adams.

  • Added missing implementation of Real64.nextAfter function.

  • Added Unsafe.Real64 structure that implements bit casts between double-precision reals and 64-bit words.

SML/NJ Library

In addition to the bug fixes noted below, the following improvements made to the SML/NJ Library:

  • Rewrote the JSON parsers to work directly on the input source (instead of using a ML-ulex lexer. This change fixes[Issue #284 (ML-ULex’s memoization causes massive performance penalties for JSON parsing). For the data.json file mentioned in the issue, parsing is about eight times faster, while the speedup is even greater for the huge.json file.

  • Added the JSONDecode structure to the JSON library. This module implements a set of combinators (inspired by the Elm JSON.Decode module) for decoding JSON values.

  • Added insertWith, insertWithi, and findAndRemove operations to the HASH_TABLE and MONO_HASH_TABLE interfaces (and corresponding implementations).

  • Fixed the error checking and documentation for the subArray function in the DynamicArray structure and DynamicArrayFn functor.

  • Fixes to the subArray and truncate functions in the dynamic array implementation (both structure DynamicArray and functor DynamicArrayFn).

  • Add EditDistance module to utility library.

  • Reverted the change to the JSON.json datatype from 2023.1 by removing the INTLIT of string constructor. We decided to take a more general approach to handling literals that will be included in a future version of the JSON library.


Here is a list of the issues that are fixed (or closed) with this release.

Issue Description


"Unable to build LLVM" error with 2023.1


DynamicArray.subArray creates array with length bound+1


Support forward-slash ("/") as a separator in the Windows implementation of OS.Path


Incorrect printing of source code in error message

We also fixed the following bugs that did not have issues associated with them (or were bug fixes ported from the legacy repository):

Supported systems

We believe that SML/NJ will build and run on the following systems, but have only tested some of them:

Architecture Operating System Status


macOS 11 (Big Sur)

macOS 12 (Monterey)


macOS 13 (Ventura)


macOS 14 (Sonoma)


Ubuntu 20.04.6 LTS


Ubuntu 22.04.2 LTS