Giter Club home page Giter Club logo

mlkit's Introduction

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

Build Status

Installation

Under macOS, MLKit is available through Homebrew: Just execute brew install mlkit. Under Linux, you may install a binary version of MLKit using an mlkit PPA from Launchpad.

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-based memory management.

  • Native backend for the x64 architecture (under Linux and macOS).

  • 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 macOS 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 after Compilation

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_x64_tgz

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

For building packages containing both MLKit and SMLtoJs, consult the Makefile.

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 the MLKit, execute the following commands:

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

The make bootstrap command is optional.

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.