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_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/legacy/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 a bug in
Random.randReal
on 32-bit systems. -
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. -
Reworked the
UTF8
structure to impose stricter validation of the encodings. Added theInvalid
exception for when an invalid encoding is encountered and replaced uses of theDomain
exception 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.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 |
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.