:version: 2023.1
:date: December 10, 2023
:dist-dir: https://smlnj.org/dist/working/{version}/
:history: {dist-dir}HISTORY.html
:issue-base: https://github.com/smlnj/smlnj/issues
:legacy-issue-base: https://github.com/smlnj/legacy/issues
:pull-base: https://github.com/smlnj/smlnj/pull
:legacy-pull-base: https://github.com/smlnj/legacy/pull/
:stem: latexmath
:source-highlighter: pygments
:stylesheet: release-notes.css
:notitle:

= Standard ML of New Jersey Release Notes

[subs=attributes]
++++
<div class="smlnj-banner">
  <span class="title"> Standard ML of New Jersey <br/> Release Notes </span>
  <br/> <br/>
  <span class="subtitle"> Version {version} <br/> {date} </span>
</div>
++++

''''''''
--
SML/NJ HOME::
  https://www.smlnj.org/index.html[[.tt]#https://smlnj.org#]
FILES::
  {dist-dir}index.html[[.tt]#{dist-dir}#]
--
''''''''

== Summary

This is a bug-fix release of the development version of **SML/NJ**.
The most important fix is that the system now correctly supports
**Linux** and the latest versions of **macOS**.  This release also
incorporates a number of fixes from the legacy version
https://smlnj.org/dist/working/110.99.4/index.html[110.99.4].

== Details

=== Compiler

* Reworked the handling of relocation patching to resolve issues with
  the **ELF** object-file format on **Linux** systems.

=== 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.

* Added modules for the representation of booleans, integers, and words
  as hash-consed values to the HashCons library.

* Reworked the `UTF8` structure to impose stricter validation of the
  encodings ({issue-base}/276[Issue 276]).

* Modified the `JSON.json` datatype to include the `INTLIT of string`
  constructor (this change is to support future improvements to the JSON
  parsers).
--

=== Installation

Added *macOS* 14 (Sonoma) as a recognized system.

== Bugs

Here is a list of the issues that are fixed (or closed) with this release.

[.buglist,cols="^1,<15",strips="none",options="header"]
|=======
| Issue
| Description
| [.bugid]#32#
| {issue-base}/32[`ml-makedepend` trashes dependency file on error]
| [.bugid]#233#
| {issue-base}/233[Installation of SML/NJ 2021.1 fails on Ubuntu 20.04]
| [.bugid]#261#
| {issue-base}/261[2022.1 distro bombs]
| [.bugid]#272#
| {issue-base}/272[Unable to build LLVM when running `build.sh`]
| [.bugid]#276#
| {issue-base}/276[`UTF8.getu` should validate that it's input is UTF-8]
// | [.bugid]#@ID@#
// | @DESCRIPTION@
|=======

We also fixed the following bugs that did not have issues
associated with them (or were bug fixes ported from the legacy
repository):

--
* {legacy-issue-base}/256[Initial numbers generated by `Util/random.sml` have unexpected regularities]
* {legacy-issue-base}/258[Thompson NFA regex engine doesn’t advance stream position when matching]
* {legacy-pull-base}/264[Fix `VectorSlice.all` and `ArraySlice.all`]
* {legacy-issue-base}/278[`CharBuffer.addSlice` does not properly handle starting offsets]
* {legacy-issue-base}/279[`HashSetFn`'s calculation of `maxSize` can cause `Overflow` during functor instantiation]
* {legacy-issue-base}/287[The word literal `0wx80000000` is incorrectly converted to `0wx7FFFFFFF80000000`]
* 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:

[.support-table,cols="^2s,^4v,^3v",options="header",strips="none"]
|=======
| 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
| {nbsp} | |
|=======
