Giter VIP home page Giter VIP logo

mlton's Introduction

Build Status

MLton

MLton is a whole-program optimizing compiler for the Standard ML programming language.

Features

  • Portability. Runs on the following platforms:

    • ARM: Linux (Debian).
    • Alpha: Linux (Debian).
    • AMD64: Darwin (Mac OS X), FreeBSD, Linux (Debian, Fedora, ...), Solaris (10 and above).
    • HPPA: HPUX (11.11 and above), Linux (Debian).
    • IA64: HPUX (11.11 and above), Linux (Debian).
    • PowerPC: AIX (5.2 and above), Darwin (Mac OS X), Linux (Debian, Fedora).
    • PowerPC64: AIX (5.2 and above).
    • S390: Linux (Debian).
    • Sparc: Linux (Debian), Solaris (8 and above).
    • X86: Cygwin/Windows, Darwin (Mac OS X), FreeBSD, Linux (Debian, Fedora, ...), MinGW/Windows, NetBSD, OpenBSD, Solaris (10 and above).
  • Robustness.

    • Supports the full SML 97 language as given in The Definition of Standard ML (Revised).
    • A complete implementation of the Basis Library.
    • Generates standalone executables.
    • Compiles large programs.
    • Support for large amounts of memory (up to 4G on 32-bit systems; more on 64-bit systems).
    • Support for large array lengths (up to 2^31 - 1 on 32-bit systems; up to 2^63-1 on 64-bit systems).
    • Support for large files, using 64-bit file positions.
  • Performance.

    • Executables have excellent running times.
    • Generates small executables.
    • Untagged and unboxed native integers, reals, and words.
    • Unboxed native arrays.
    • Multiple garbage collection strategies.
    • Fast arbitrary-precision arithmetic based on the GnuMP.
  • Tools.

    • Source-level profiling for both time and allocation.
    • MLLex lexer generator.
    • MLYacc parser generator.
    • ML-NLFFIGEN foreign-function-interface generator.
  • Extensions.

    • A simple and fast C FFI that supports calling from SML to C and from C to SML.
    • The ML Basis system for programming in the very large.
    • Libraries for continuations, finalization, interval timers, random numbers, resource limits, resource usage, signal handlers, object size, system logging, threads, weak pointers, and world save and restore.

Instructions to build from source

Prerequisites

  • GCC 4.1.x or later
  • GNU Multiple Precision Library. Check if GMP is already present on your system (whereis gmp libgmp), typically on GCC search path (gcc -v -x c -E -).
  • MLton (recommended) or some other SML compiler to bootstrap. The easiest way is to install a pre-built binary package for MLton using your package manager. If using SML/NJ, see Compiling with SML/NJ.

Build instructions

MLton can be built from source using the usual ./configure && make && make install sequence to install under the system default installation directory (typically, /usr/local). Optionally, you can specify the --prefix argument to install MLton into a custom directory.

You can instruct MLton to look for gmp.h outside your include path or for libgmp outside your library search path using --with-gmp-lib and --with-gmp-include configure options, as in:

gzip -cd mlton-*.tgz | tar xvf -

# execute under the extracted directory
./configure \
  --prefix=$HOME/opt \
  --with-gmp-include=/usr/local/include \
  --with-gmp-lib=/usr/local/lib
make
make install

Optionally, you can pass C compiler and linker flags to set MLton's -cc-opt and -link-opt compile-time options via XCFLAGS and XLDFLAGS environment variables:

./configure \
  XCFLAGS='-I/usr/local/include' \
  XLDFLAGS='-L/usr/local/lib'

If building from source cloned from Github, first generate the configure script (requires GNU Autotools):

autoreconf -vfi
# can now ./configure && make && make check && make install && make clean

To uninstall, simply delete the directory containing the MLton installation.

Resources

For more information, go to the MLton home page.

There are two mailing lists available.

doc (and share/doc) directory contents:

    README                  this file
    changelog               changelog
    cm2mlb/                 a utility for producing ML Basis programs in SML/NJ
    cmcat/                  a utility for producing whole programs in SML/NJ
    examples/               example SML programs
    guide/                  HTML MLton guide (copy of the MLton wiki)
    license/                license information
    mllex.pdf               user guide for mllex lexer generator
    mlton-guide.pdf         PDF version of MLton guide
    mlyacc.pdf              user guide for mlyacc parser generator

Need help? Found a bug?

Submit an issue if you need any help. We welcome pull requests with bug fixes or changes.

mlton's People

Contributors

sweeks avatar matthewfluet avatar terpstra avatar jasoncarr0 avatar laurikari avatar bleibig avatar mattsurawski avatar kmb3398 avatar myegorov avatar kravikum avatar vedantraiththa avatar bxc8214 avatar jlouis avatar robsimmons avatar tsuyoshi2 avatar agoode avatar danielrosenwasser avatar caltry avatar alexanderaa avatar inquisitivecoder avatar dmoerner avatar kentlwilson avatar mauricioca avatar jonsterling avatar jez avatar bikallem avatar hai-nguyen-van avatar favonia avatar

Watchers

James Cloos avatar  avatar

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.