Standard ML Compiler and Toolkit
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
basis Merge pull request #19 from melsman/performance-improvement-odbc Feb 22, 2018
doc added .gitignore files May 23, 2014
js improved testing of packreal (#20) Feb 23, 2018
kitdemo hoisted files one level May 21, 2014
kitlib hoisted files one level May 21, 2014
man/man1 cleanup Dec 3, 2017
ml-yacc-lib hoisted files one level May 21, 2014
smlserver/xt hoisted files one level May 21, 2014
smlserver_demo added .gitignore files May 23, 2014
src fix Feb 23, 2018
test improved testing of packreal (#20) Feb 23, 2018
test_dev hoisted files one level May 21, 2014
vagrant added documentation Aug 22, 2018
.gitignore fixes May 23, 2014
.travis.yml some fixes Aug 25, 2018
Dockerfile Add a simple dockerfile Oct 17, 2016
Makefile.in github and travis binary deployment integration Aug 22, 2018
MakefileDist hoisted files one level May 21, 2014
Makefiledefault hoisted files one level May 21, 2014
NEWS.md update news Aug 25, 2018
NEWS_SMLSERVER.md new version Dec 10, 2017
NEWS_SMLTOJS.md new version Dec 10, 2017
README.md more fixes Dec 6, 2017
README_BARRY.md more fixes Dec 6, 2017
README_SMLSERVER.md more fixes Dec 6, 2017
README_SMLTOJS.md more fixes Dec 6, 2017
aclocal.m4 hoisted files one level May 21, 2014
autobuild hoisted files one level May 21, 2014
configure.ac some fixes Aug 22, 2018
install-sh hoisted files one level May 21, 2014
mkinstalldirs hoisted files one level May 21, 2014
to_do hoisted files one level May 21, 2014
to_do_smlserver hoisted files one level May 21, 2014

README.md

MLKit

The MLKit is a compiler for the programming language Standard ML. The MLKit covers all of Standard ML, as defined in the 1997 edition of the Definition of Standard ML and supports most of the Standard ML Basis Library.

Statistics

Issue Stats Issue Stats Build Status

MLKit Features

  • Covers all of Standard ML. The MLKit compiles all of Standard ML, including Modules, as specified by the Definition of Standard ML. The MLKit also supports large parts of the Standard ML Basis Library.

  • Supports ML Basis Files: The MLKit compiles large programs, including itself, around 80.000 lines of Standard ML plus the Standard ML Basis Library. The support for ML Basis Files makes it easy to compile a program with different Standard ML compilers. Currently, both MLton and the MLKit supports the concept of ML Basis Files.

  • Region-Based Memory Management: Memory allocation directives (both allocation and deallocation) are inferred by the compiler, which uses a number of program analyses concerning lifetimes and storage layout. The MLKit compiler is unique among ML implementations in this respect.

  • Reference-tracing Garbage Collection: The MLKit supports reference-tracing garbage collection in combination with region memory management.

  • Native backend for the x86 architecture.

  • Documentation. A comprehensive guide on programming with the MLKit is available. Documentation is also available in man-pages and from the MLKit home page.

MLKit Cousins

This repository also includes the sources for the following tools, which are built on top of MLKit:

  • SMLToJs. A compiler that compiles all of Standard ML into JavaScript.

  • SMLserver. A compiler and Apache module that allow for Standard ML to be efficiently executed in a web-server context.

  • Barry. A Standard ML source-to-source compiler that will eliminate modules, using static interpretation and generate optimised Core-language Standard ML code.

License and Copyright

The MLKit compiler is distributed under the GNU Public License, version 2. See the file MLKit-LICENSE for details. The runtime system (/src/Runtime/) and libraries (basis/) is distributed under the more liberal MIT License.

Compilation Requirements

To compile, install, and use the MLKit, a Linux box running Ubuntu Linux, Debian, gentoo, or similar is needed. The MLKit also works on Mac OS and has also earlier been reported to run on the FreeBSD/x86 platform, with a little tweaking.

To compile the MLKit, a Standard ML compiler is needed, which needs to be one of the following:

MLton >= 20051202:

$ mlton
MLton 20051202 (built Sat Dec 03 04:20:11 2005 on pavilion)

A working MLKit compiler >= 4.3.0:

$ mlkit -V
MLKit version 4.3.0, Jan 25, 2006 [X86 Backend]

Moreover, gcc is needed for compiling the runtime system and related tools.

Compilation

After having checked out the sources from Github, execute the command:

$ ./autobuild

Now, cd to the toplevel directory of the repository and execute the appropriate set of commands:

Compile with MLton alone (Tested with 3Gb RAM):

$ ./configure
$ make mlkit

Compile with existing MLKit (Tested with 1Gb RAM):

$ ./configure --with-compiler=mlkit
$ make mlkit

If you later want to install the MLKit in your own home directory, you should also pass the option --prefix=$HOME/mlkit to ./configure above.

For binary packages, we use

$ ./configure --sysconfdir=/etc --prefix=/usr

Bootstrapping (optional - works with 1Gb RAM)

This step is optional. If you want the resulting executable compiler to be bootstrapped (compiled with itself), execute the command:

$ make bootstrap

Be aware that this step takes some time.

Pre-compile Basis Library and Kit-Library

Execute the following command:

$ make mlkit_libs

Installation

For a system wide installation of the MLKit, installation including man-pages and tools, execute the command:

$ sudo make install

For a personal installation, with --prefix=$HOME/mlkit given to ./configure, execute the following command:

$ make install

Making a Binary Package

To build a binary package, execute the command

$ make mlkit_i386_tgz

This command leaves a package mlkit-X.Y.Z-i386.tgz in the dist/ directory. For building a binary package, the installation step above is not needed and the bootstrapping step is optional.

Try It

To test the installation, copy the directory /usr/share/mlkit/kitdemo to somewhere in your own directory, say $HOME/kitdemo:

$ cp -a /usr/share/mlkit/kitdemo $HOME/kitdemo
$ cd $HOME/kitdemo
$ mlkit helloworld.sml

The MLKit should produce an executable file run:

$ ./run
hello world

More Information

See the MLKit home page.

Documentation for the MLKit is located in the directories doc/mlkit and man/man1. License information is located in the file doc/license/MLKit-LICENSE.

Comments and Bug Reports

The MLKit has a number of known bugs and limitations. To file a bug-report, create an issue at the Github page.

Appendix A: Directory Structure of the Sources

kit/
   README
   configure
   Makefile.in
   src/
   basis/
   doc/mlkit.pdf
      /license/MLKit-LICENSE
   man/man1/rp2ps.1
   kitdemo/
   test/

Appendix B: Quick Compilation and Installation Guide

We assume that MLton >= 20051202 is installed on the system as described above.

After having checked out the sources from Github, execute the command:

$ ./autobuild

To compile and install the MLKit, execute the following commands:

$ ./configure
$ make mlkit
$ make bootstrap
$ make mlkit_libs

To install the MLKit and related tools, execute:

$ sudo make install

See the section "Try It" above to test the installation.

Appendix C: Displaying Region Flow Graphs with VCG

The VCG tool can be used to show region flow graphs.