Summary
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.
Details
CM
-
The system/cmb-make script now runs with the
CM_VERBOSE
environment variable set tofalse
by default (use the-verbose
option for the old behavior). It also now sets thePATH
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 missingReal.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 https://github.com/smlnj/smlnj/issues/284[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 thehuge.json
file. -
Added the
JSONDecode
structure to the JSON library. This module implements a set of combinators (inspired by the ElmJSON.Decode
module) for decoding JSON values. -
Added
insertWith
,insertWithi
, andfindAndRemove
operations to theHASH_TABLE
andMONO_HASH_TABLE
interfaces (and corresponding implementations). -
Fixed the error checking and documentation for the
subArray
function in theDynamicArray
structure andDynamicArrayFn
functor. -
Fixes to the
subArray
andtruncate
functions in the dynamic array implementation (both structureDynamicArray
and functorDynamicArrayFn
). -
Add
EditDistance
module to utility library. -
Reverted the change to the
JSON.json
datatype from 2023.1 by removing theINTLIT 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.
Bugs
Here is a list of the issues that are fixed (or closed) with this release.
Issue | Description |
---|---|
279 |
|
280 |
|
281 |
Support forward-slash ("/") as a separator in the Windows implementation of |
288 |
We also fixed the following bugs that did not have issues associated with them (or were bug fixes ported from the legacy repository):
-
Issue #269 (
Real.realMod
andReal.split
produce incorrect result for values close to zero) -
Support forward-slash ("/") as a separator in the Windows implementation of
OS.Path
-
Issue #283 (
TextIO.inputAll
segfaults when reading 980M file). -
ML-ULex’s memozation causes massive performance penalties for JSON parsing
-
Unmatched specification in opaque signature ascription causes uncaught exception
-
The word literal
0wx80000000
is incorrectly converted to0wx7FFFFFFF80000000
-
Uncaught
Bind
exception in compiler with opaque signature matching -
CM cannot find tools when using cmb-make to compile the compiler
-
The
fromDecimal
andtoDecimal
functions in theReal
structure are not implemented -
Issue #300 (
PackReal64
{Big
,Little
}.update
is not implemented). -
The implementations of
PackWord64Little.update
andPackWord64Big.update
were swapped on 64-bit platforms.
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 |
---|---|---|
AMD64 |
||
macOS 11 (Big Sur) |
||
macOS 12 (Monterey) |
Tested |
|
macOS 13 (Ventura) |
Tested |
|
macOS 14 (Sonoma) |
Tested |
|
Ubuntu 20.04.6 LTS |
Tested |
|
Ubuntu 22.04.2 LTS |
Tested |
|
|