Summary
This release completes the overhaul of primitive operators in the compiler that was started in 110.86. Most of the changes listed here were part of the 110.86 release, but we include them here since 110.86 was not officially announced.
Details
Installation
While the installer for 110.87 works on macOS 10.14 Mojave, building from source requires some extra steps.
SML/NJ Library
Renamed the function CharBufferPP.openOut
to openBuf
, and added the
TextPP
structure that supports pretty printing to either an output
stream (like TextIOPP
) or a character buffer (like CharBufferPP
).
ASDL
Further improvements to the new implementation of ASDL.
-
The interface to file and memory picklers was unified for the SML view.
-
Added support for S-Expression pickling for the SML view (unpickling has not yet been implemented).
-
Significant editing of the documentation to make it more accurately reflect the implementation.
Compiler
110.86 changes
We have made a number of changes to internal representations and implementations as part of the preparation for supporting 64-bit targets. We summarize these below (see the change log for details).
-
Moved CPS related code out of the FLINT directory and into its own
compiler/CPS
directory tree. -
Split out the utility code from the
CPS
structure into a newCPSUtil
structure. -
Renamed the various CPS primitive constructors so as to be compatible with ASDL (i.e., changed symbolic and lower-case constructor names to upper-case identifiers).
-
Moved the
F_SGN
constructor from thefcmp
datatype to thebranch
datatype (and renamed itFSGN
). -
Many changes to the internal representation of primitive operators.
We have also made improvements to the core 64-bit arithmetic operations.
Culled unused flags from the Control
structure (mostly from Control.CG
).
110.87 changes
In 110.87, we continue the overhaul of the compiler’s handling of primitive
operations by introducing a new, more consistent, naming scheme for the
operations that are exposed by the compiler in the InLine
structure.
In particular, we have abstracted away from the size of the default integer
and word types (both in the names and in the semantics of numeric conversions).
The compiler now inlines the Char.chr
operator.
Interactive System
The implementation of the use
function in the REPL has been rewritten to
fix bugs 193, 217, and 219. The semantics of
use
are as follows:
-
If an invocation of
use
encounters a compilation error (either in the initial file or in a nested invocation ofuse
), then the compiler error message will be printed and the call touse
will immediately return()
. -
If an invocation of
use
raises an exception during execution of the compiled code (either in the initial file or in a nested invocation ofuse
), then the exception will be reported at the top-level. -
Otherwise, if no errors or uncaught exceptions are encountered, then
()
will be returned once the code in the used file has executed.
Note that any change to the global state or environment
that occurs before an error is encountered, will not be rolled
back. Also, wrapping calls to use
in exception handlers or using
callcc
in combination with use
may break it.
Files specified as command-line arguments to the sml command
are treated as if use
was invoked on them. If there is an
error, then the error is reported and the sml command
will terminate with a non-zero exit status (at least on Unix).
Bugs
Here is a list of tracked bugs fixed (or closed) with this release, please see the bug tracker for more details.
193 |
SML/NJ does not print unhandled exceptions in loaded files |
213 |
|
217 |
Unhandled exceptions no longer print anything when inside used file |
219 |
"use" fails silently when a function inside a structure raises an exception |
The following unnumbered bugs were also fixed:
-
The
Word32.toInt
function did not raiseOverflow
when given an argument with its sign bit set in some cases (e.g.,Word32.toInt 0wx8002DE32;
would return187954
).
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 |
---|---|---|
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) |
Tested |
|
macOS 10.13 (High Sierra) |
Tested |
|
macOS 10.14 (Mojave) |
Tested |
|
Ubuntu 16.04.3 LTS |
Tested |
|
Other Linux variants |
||
BSD variants |
||
Windows 7 |
||
Windows 10 |
||
Cygwin (32-bit) |
A note about 64-bit support
Apple is in the process of deprecating 32-bit support in macOS. With macOS 10.14 Mojave, compiling 32-bit applications, such as the SML/NJ runtime system, requires using an older SDK. The SML/NJ installer, however, works without issue on macOS 10.14 Mojave.
We have been working on 64-bit support since 110.82 we expect to have it in place before the release of macOS 10.15.