Summary
This patch release fixes a large number of bugs in the "legacy" version of SML/NJ; implements some missing features from the Standard ML Basis Library, and includes some improvements to the SML/NJ Library.
Details
Compiler
-
Some minor improvements in the REPL’s pretty printing.
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/legacy/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 a bug in
Random.randRealon 32-bit systems. -
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. -
Reworked the
UTF8structure to impose stricter validation of the encodings. Added theInvalidexception for when an invalid encoding is encountered and replaced uses of theDomainexception withInvalid. Also added thesize'function for getting the number of UTF-8 characters in a substring. -
Added modules for the representation of booleans, integers, and words as hash-consed values to the HashCons library.
Bugs
Here is a list of the issues that are fixed (or closed) with this release. We include the original bug numbers for bugs that were reported using the gforge bug tracker.
| Issue | Description | Gforge Bug |
|---|---|---|
194 |
221 |
|
269 |
|
n.a. |
280 |
Support forward-slash ("/") as a separator in the Windows implementation of |
n.a. |
283 |
n.a. |
|
284 |
ML-ULex’s memozation causes massive performance penalties for JSON parsing |
n.a. |
285 |
Unmatched specification in opaque signature ascription causes uncaught exception |
n.a. |
286 |
n.a. |
|
287 |
The word literal |
n.a. |
288 |
n.a. |
|
289 |
Uncaught |
n.a. |
290 |
n.a. |
|
292 |
n.a. |
|
294 |
n.a. |
|
295 |
CM cannot find tools when using cmb-make to compile the compiler |
n.a. |
296 |
The |
n.a. |
297 |
n.a. |
|
298 |
n.a. |
|
300 |
n.a. |
|
302 |
SML/NJ implementation of |
n.a. |
We also fixed the following bugs that did not have issues associated with them (or were bug fixes back-ported from the development repository):
-
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 |
FreeBSD 12.0 |
|
macOS 10.14 (Mojave) |
Tested |
|
macOS 10.15 (Catalina) |
Tested |
|
macOS 11 (Big Sur) |
Tested |
|
macOS 12 (Monterey) |
Tested |
|
Ubuntu 16.04.3 LTS |
||
Ubuntu 18.04.3 LTS |
Tested |
|
|
||
Power PC |
Mac OS X 10.5 (Leopard) |
|
AIX |
||
|
||
Sparc |
Solaris |
|
Linux |
||
|
||
x86 (32-bit) |
Mac OS X 10.6 (Snow Leopard) |
|
Mac OS X 10.7 (Lion) |
||
Mac OS X 10.8 (Mountain Lion) |
||
Mac OS X 10.9 (Mavericks) |
||
Mac OS X 10.10 (Yosemite) |
||
Mac OS X 10.11 (El Capitan) |
||
macOS 10.12 (Sierra) |
||
macOS 10.13 (High Sierra) |
||
macOS 10.14 (Mojave) |
||
Ubuntu 16.04.3 LTS |
||
Other Linux variants |
||
FreeBSD 12.0 |
||
Other BSD variants |
||
Windows 7 |
||
Windows 10 |
||
Cygwin (32-bit) |
||
|
32-bit macOS issues
While the x86 installer for 110.99.5 works on macOs 10.14 Mojave, building from source requires some extra steps because the version of Xcode distributed for Mojave does not include a 32-bit SDK.
Another issue that you may encounter when building on macOs 10.14 Mojave is an error message for a shell script of the form
/bin/sh: bad interpreter: Operation not permitted
This error arises because the com.apple.quarantine attribute is set on the
shell script. To fix the problem, remove the attribute using the command
xattr -d com.apple.quarantine shell-script
and resume the build.