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_VERBOSEenvironment variable set tofalseby default (use the-verboseoption for the old behavior). It also now sets thePATHenvironment 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.EXACTformatting mode and implemented the missingReal.toDecimal/fromDecimalfunctions. The real-string conversions is based on the Ryu library and associated PLDI paper by Ulf Adams. -
Added missing implementation of
Real64.nextAfterfunction. -
Added
Unsafe.Real64structure 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.jsonfile mentioned in the issue, parsing is about eight times faster, while the speedup is even greater for thehuge.jsonfile. -
Added the
JSONDecodestructure to the JSON library. This module implements a set of combinators (inspired by the ElmJSON.Decodemodule) for decoding JSON values. -
Added
insertWith,insertWithi, andfindAndRemoveoperations to theHASH_TABLEandMONO_HASH_TABLEinterfaces (and corresponding implementations). -
Fixed the error checking and documentation for the
subArrayfunction in theDynamicArraystructure andDynamicArrayFnfunctor. -
Fixes to the
subArrayandtruncatefunctions in the dynamic array implementation (both structureDynamicArrayand functorDynamicArrayFn). -
Add
EditDistancemodule to utility library. -
Reverted the change to the
JSON.jsondatatype from 2023.1 by removing theINTLIT of stringconstructor. 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.realModandReal.splitproduce incorrect result for values close to zero) -
Support forward-slash ("/") as a separator in the Windows implementation of
OS.Path -
Issue #283 (
TextIO.inputAllsegfaults 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
0wx80000000is incorrectly converted to0wx7FFFFFFF80000000 -
Uncaught
Bindexception in compiler with opaque signature matching -
CM cannot find tools when using cmb-make to compile the compiler
-
The
fromDecimalandtoDecimalfunctions in theRealstructure are not implemented -
Issue #300 (
PackReal64{Big,Little}.updateis not implemented). -
The implementations of
PackWord64Little.updateandPackWord64Big.updatewere 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 |
|
|