MSVC compatibility tweak
Remove some warnings

heads

tip
browse log

clone

read-only
https://hg.sr.ht/~cannam/mlton-cutdown
read/write
ssh://hg@hg.sr.ht/~cannam/mlton-cutdown

#Build and run scripts for cut-down MLton runtimes

All of these are built without any GMP support. The runtime will simply abort if any LargeInt/IntInf function is called. The intention is for use with for 64-bit MLton using the -default-type int64 option, so that FixedInt = Int = 64-bit integers.

To use these, you must separately have a MLton installed somewhere that is capable of compiling to a C target with correct layout for the desired architecture, even if it does not target the same OS platform.

#1. Windows using Clang with Visual C++ ABI compatibility

Builds a MLton runtime for x86_64 Windows, without GMP support, using the Clang compiler included with Visual Studio 2019, with Visual C++ ABI compatibility.

To build:

> cd windows
> build-runtime-library.bat

To run, use windows\mlton.bat with the usual MLton arguments. This runs a separate installation of MLton to compile to C and then compiles the C code against the runtime library built in the previous step. Currently the installed MLton location is hard-coded in windows\mlton.ps1.

#2. iOS

Builds MLton runtimes for aarch64 iOS (device) and x86_64 iOS (simulator), without GMP support. Must be run from macOS.

$ cd ios
$ ./build-runtime-library.sh

To copy an installed version of MLton and modify it so as to produce iOS binaries with this runtime:

$ cd ios
$ ./implant-runtime.sh

Note that this actually requires two installed versions of MLton - one in /usr/local built for arm64 and one in /usr/local/x86_64 built for x86_64. To implant only one, comment out the other architecture in the script.

To run, use ios/$arch/bin/mlton with the usual MLton arguments.

#2. macOS

Builds MLton runtimes for aarch64 x86_64 macOS, without GMP support.

$ cd macos
$ ./build-runtime-library.sh

To copy an installed version of MLton and modify it so as to produce binaries with this runtime:

$ cd macos
$ ./implant-runtime.sh

Note that this actually requires two installed versions of MLton - one in /usr/local built for arm64 and one in /usr/local/x86_64 built for x86_64. To implant only one, comment out the other architecture in the script.

To run, use macos/$arch/bin/mlton with the usual MLton arguments.