Standard ML of New Jersey Release Notes

Standard ML of New Jersey
Release Notes
Version 110.99.4
August 1, 2023

SML/NJ HOME

  https://smlnj.org

FILES

  https://smlnj.org/dist/working/110.99.4/

## Summary

This patch release fixes a number of bugs in the "legacy" version of SML/NJ.

## Details

### MLRISC

Modified the way that zero-extension (`ZX`) is handled when the source bit width is smaller than the target. Previously, the code assumed that the high bits would be zero, but as demonstrated by issue #272, this is not guaranteed, so we now mask out the high bits.

### SML/NJ Library

- Added the `NativeInt` and `NativeWord` structure aliases to provide a portable way to refer to the native numeric types in signatures.

- Reimplementation of the `Random` structure to use the Mersenne Twister algorithm. There are both 32-bit and 64-bit versions of the generator (which one is included depends on the target platform).

- Reworked the code for determining the maximum hash-table size (used in the `HashSetFn` and `HashTableRep` modules) so that it does not depend on `Int.int` and `Word.word` being the same size (an issue for MLton). Also split that code out into the internal `MaxHashTableSize` module.

- Added support for the end-of-line assertion ("$") and full support for intervals to the Thompson engine in the RegExp library.

### Installation

Added macOS 14 (Sonoma) as a recognized system.

### 32-bit macOS issues

While the x86 installer for 110.99.4 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.

## Bugs

Here is a list of the issues and pull requests 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
--- | --- | ---
87 | `ml-makedepend` trashes dependency file on error | 71
256 | Initial numbers generated by `Util/random.sml` have unexpected regularities | n.a.
258 | Thompson NFA regex engine doesn’t advance stream position when matching | n.a.
260 | 64-bit word literals are parsed incorrectly on 32-bit systems | n.a.
264 | Fix `VectorSlice.all` and `ArraySlice.all` | n.a.
266 | config: restore PPC for 10.4 and 10.6 | n.a.
267 | Update makefile | n.a.
272 | Calling C function via NLFFI binding may give result outside range of its C return type | n.a.
278 | `CharBuffer.addSlice` does not properly handle starting offsets | n.a.
279 | `HashSetFn’s calculation of `maxSize` can cause `Overflow` during functor instantiation | n.a.

The following unnumbered bugs were also fixed:

- The `ULexBuffer.getu` function did not handle 4-byte UTF-8 sequences in some situations.

- The `ULexBuffer.getu` function did not reject surrogate halves or too-large codepoints.

## 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
| macOS 13 (Ventura) | Tested
| macOS 14 (Sonoma beta) | Tested
| Ubuntu 20.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) |