Summary
This release is a major milestone in the development of SML/NJ. Thanks to the LLVM backend, we now have native support for the Arm64 (a.k.a. AArch64) architecture running macOS. In addition, this release includes bug fixes and improvements ported from the Legacy repository.
Details
Command-line Tools
The mechanism to create standalone executable programs has been updated to take
advantage of the LLVM infrastructure. Specifically, the heap2asm program
has been replaced by the heap2obj program that directly converts an exported
heap image to a native object file. The heap2exec script has been modified to
use heap2obj. Currently we only support static linking of executables.
We have also added support for creating executables to the ml-build script.
See the manual pages in the documentation for details.
Compiler
-
The code-object API has been changed to make is easier to manage JIT’d code on macOS/arm64. This change should also reduce the amount of data copying when generating binfiles.
-
Switched the backend code generator to use LLVM Version 18.1.8. The
llvm10submodule has been removed. -
The "Jump-with-Arguments" (JWA) calling convention that we added to LLVM no longer requires that functions have the
nakedattribute. Instead, we have modified the prologue-epilogue-insertion pass to skip adding code to functions. -
Ported several fixes and improvements from the legacy repository. These include Legacy Issues #340 and #341), and the addition of some missing fusion rules for conversions via the
IntInf.inttype.
Runtime System
-
The heap-image format was modified and has a new version number.
-
The representation of big-object regions in the heap was changed to avoid issues with write protection for executable code on macOS/arm64.
-
Collecting basic statistics about memory allocation and GC is now enabled by default in the garbage collector. Access to this information is via the
SMLofNJ.Internals.GCstructure (see below).
Basis Library
-
Added
numGensandnurserySizeInBytesfunctions to theSMLofNJ.Internals.GCstructure, with corresponding runtime-system support. -
Added the
resetCountersandreadCountersfunctions to theSMLofNJ.Internals.GCstructure. These functions can be used to get the GC and allocation statistics maintained by the runtime system. -
Added
Unsafe.Array.create0for creating zero-length polymorphic arrays.
SML/NJ Library
The following changes were made to the Library:
-
Added the
combineWithfunction to the various implementations of theORD_SETsignature. -
Some minor improvements to hash sets and integer hash tables.
-
Added the
decode_strategymechanism to theUTF8structure. This mechanism allows specifying how to handle incomplete/invalid multibyte sequences. See Pull Request 334 for more discussion. -
Added
rawArrayandrawObjectdecoders to theJSONDecodestructure in the SML/NJ Library.
Installation
-
The installation process has been simplified; the
build.shscript now fetches the boot files fromsmlnj.orgif they are not present.
Bugs
Here is a list of the issues that are fixed (or closed) with this release.
| Issue | Description |
|---|---|
285 |
|
291 |
|
294 |
|
295 |
We also fixed the following bugs that did not have issues associated with them (or were bug fixes ported from the legacy repository):
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 14 (Sonoma) |
||
macOS 15 (Sequoia) |
Tested |
|
Ubuntu 20.04.6 LTS |
||
Ubuntu 22.04.2 LTS |
Tested |
|
|
||
Arm64 |
||
macOS 15 (Sequoia) |
Tested |
|
|