<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta name="robots" content="index,nofollow">



<title>Features - MLton Standard ML Compiler (SML Compiler)</title>
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="all" href="common.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="screen" href="screen.css">
<link rel="stylesheet" type="text/css" charset="iso-8859-1" media="print" href="print.css">


<link rel="Start" href="Home">


</head>

<body lang="en" dir="ltr">

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-833377-1";
urchinTracker();
</script>
<table bgcolor = lightblue cellspacing = 0 style = "border: 0px;" width = 100%>
  <tr>
    <td style = "
		border: 0px;
		color: darkblue; 
		font-size: 150%;
		text-align: left;">
      <a class = mltona href="Home">MLton MLTONWIKIVERSION</a>
    <td style = "
		border: 0px;
		font-size: 150%;
		text-align: center;
		width: 50%;">
      Features
    <td style = "
		border: 0px;
		text-align: right;">
      <table cellspacing = 0 style = "border: 0px">
        <tr style = "vertical-align: middle;">
      </table>
  <tr style = "background-color: white;">
    <td colspan = 3
	style = "
		border: 0px;
		font-size:70%;
		text-align: right;">
      <a href = "Home">Home</a>
      &nbsp;<a href = "Index">Index</a>
      &nbsp;
</table>
<div id="content" lang="en" dir="ltr">
MLton has the following features. <h2 id="head-b307b88c84327b1804aee227595be53342245965">Portability</h2>

    <ul>

    <li>
<p>
 Runs on a variety of platforms. 
</p>
</li>

        <ul>

        <li>
<p>
 <a href="RunningOnAMD64">AMD64</a>: 
</p>
</li>

            <ul>

            <li>
<p>
 <a href="RunningOnFreeBSD">FreeBSD</a>  
</p>
</li>
            <li>
<p>
 <a href="RunningOnLinux">Linux</a> (Debian, Red Hat, ...) 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 <a href="RunningOnHPPA">HPPA</a>: 
</p>
</li>

            <ul>

            <li>
<p>
 <a href="RunningOnHPUX">HPUX</a> (11.00 and above) 
</p>
</li>
            <li>
<p>
 <a href="RunningOnLinux">Linux</a> (Debian) 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 <a href="RunningOnPowerPC">PowerPC</a>: 
</p>
</li>

            <ul>

            <li>
<p>
 <a href="RunningOnAIX">AIX</a> (5.1 and above) 
</p>
</li>
            <li>
<p>
 <a href="RunningOnDarwin">Darwin</a> (Mac OS X) 
</p>
</li>
            <li>
<p>
 <a href="RunningOnLinux">Linux</a> (Debian) 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 <a href="RunningOnX86">X86</a>:  
</p>
</li>

            <ul>

            <li>
<p>
 <a href="RunningOnCygwin">Cygwin</a>/Windows 
</p>
</li>
            <li>
<p>
 <a href="RunningOnDarwin">Darwin</a> (Mac OS X) 
</p>
</li>
            <li>
<p>
 <a href="RunningOnFreeBSD">FreeBSD</a>  
</p>
</li>
            <li>
<p>
 <a href="RunningOnLinux">Linux</a> (Debian, Red Hat, ...) 
</p>
</li>
            <li>
<p>
 <a href="RunningOnMinGW">MinGW</a>/Windows 
</p>
</li>
            <li>
<p>
 <a href="RunningOnNetBSD">NetBSD</a> 
</p>
</li>
            <li>
<p>
 <a href="RunningOnOpenBSD">OpenBSD</a> 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 <a href="RunningOnSparc">Sparc</a> 
</p>
</li>

            <ul>

            <li>
<p>
 <a href="RunningOnLinux">Linux</a> (Debian) 
</p>
</li>
            <li>
<p>
 <a href="RunningOnSolaris">Solaris</a> 
</p>
</li>

            </ul>



        </ul>



    </ul>


<h2 id="head-8aa709faedc93ee0f2dd837347b1b6c2880d34d1">Robustness</h2>

    <ul>

    <li>
<p>
 Supports the full SML 97 language as given in <a href="DefinitionOfStandardML">The Definition of Standard ML (Revised)</a>.   <br>
If there is a program that is valid according to The Definition that  is rejected by MLton, or a program that is invalid according to the  Definition that is accepted by MLton, it is a bug.  For a list of  known bugs, see <a href="UnresolvedBugs">UnresolvedBugs</a>. 
</p>
</li>
    <li class="gap">
<p>
 A complete implementation of the <a href="BasisLibrary">Basis Library</a>.  <br>
MLton's implementation matches latest Basis Library specification,  and includes a complete implementation of all the required modules,  as well as many of the optional modules. 
</p>
</li>
    <li class="gap">
<p>
 Generates standalone executables.  <br>
No additional code or libraries are necessary in order to run an  executable, except for the standard shared libraries.  MLton can  also generate statically linked executables. 
</p>
</li>
    <li class="gap">
<p>
 Compiles large programs.  <br>
MLton is sufficiently efficient and robust that it can compile large  programs, including itself (over 140K lines).  The distributed  version of MLton was compiled by MLton. 
</p>
</li>
    <li class="gap">
<p>
 Support for large amounts of memory (up to 4G on 32-bit systems; more on 64-bit systems). 
</p>
</li>
    <li class="gap">
<p>
 Array lengths up to 2<sup>31</sup> - 1, the largest possible twos-complement 32-bit integer.  
</p>
</li>
    <li class="gap">
<p>
 Support for large files, using 64-bit file positions. 
</p>
</li>

    </ul>


<h2 id="head-63c904559993935c470f516c8b549ca7f3640dbb">Performance</h2>

    <ul>

    <li>
<p>
 Executables have <a href="Performance">excellent running times</a>. 
</p>
</li>
    <li class="gap">
<p>
 Generates small executables.  <br>
MLton takes advantage of whole-program compilation to perform very  aggressive dead-code elimination, which often leads to smaller  executables than with other SML compilers. 
</p>
</li>
    <li class="gap">
<p>
 Native integers, reals, and words.  <br>
In MLton, integers and words are 32 bits and arithmetic does not  have any overhead due to tagging or boxing.  Also, reals are stored  unboxed, avoiding any overhead due to boxing. 
</p>
</li>
    <li class="gap">
<p>
 Unboxed native arrays.  <br>
In MLton, an array (or vector) of integers, reals, or words uses the  natural C-like representation.  This is fast and supports easy  exchange of data with C.  Monomorphic arrays (and vectors) use the  same C-like representations as their polymorphic counterparts. 
</p>
</li>
    <li class="gap">
<p>
 Multiple <a href="GarbageCollection">garbage collection</a> strategies. 
</p>
</li>
    <li class="gap">
<p>
 Fast arbitrary precision arithmetic (<tt>IntInf</tt>) based on the <a href="GnuMP">GnuMP</a>.  <br>
For <tt>IntInf</tt> intensive programs, MLton can be an order of  magnitude or more faster than Poly/ML or SML/NJ.   
</p>
</li>

    </ul>


<h2 id="head-4fa8cc860c52b268dc6a3adcde7305e9415db5bb">Tools</h2>

    <ul>

    <li>
<p>
 Source-level <a href="Profiling">Profiling</a> of both time and allocation. 
</p>
</li>
    <li>
<p>
 <a class="nonexistent" href="MLLex">MLLex</a> lexer generator 
</p>
</li>
    <li>
<p>
 <a class="nonexistent" href="MLYacc">MLYacc</a> parser generator 
</p>
</li>
    <li>
<p>
 <a class="nonexistent" href="MLNLFFIGEN">ML-NLFFIGEN</a> 
</p>
</li>

    </ul>


<h2 id="head-656bcfe284e2da39c77d4fdab55b16ad3c654719">Extensions</h2>

    <ul>

    <li>
<p>
 A simple and fast C <a href="ForeignFunctionInterface">ForeignFunctionInterface</a> that supports calling from SML to C and from C to SML.  
</p>
</li>
    <li class="gap">
<p>
 The <a href="MLBasis">ML Basis system</a> for programming in the very large, separate delivery of library sources, and more. 
</p>
</li>
    <li class="gap">
<p>
 A number of extension libraries that provide useful functionality that cannot be implemented with the <a href="BasisLibrary">Basis Library</a>.  See below for an overview and <a href="MLtonStructure">MLtonStructure</a> for details. 
</p>
</li>

        <ul>

        <li>
<p>
 <a href="MLtonCont">continuations</a>   <br>
MLton supports continuations via <tt>callcc</tt> and <tt>throw</tt>. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonFinalizable">finalization</a>   <br>
MLton supports finalizable values of arbitrary type. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonItimer">interval timers</a>   <br>
MLton supports the functionality of the C <tt>setitimer</tt> function. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonRandom">random numbers</a>   <br>
MLton has functions similar to the C <tt>rand</tt> and <tt>srand</tt> functions, as well as support for access to <tt>/dev/random</tt> and <tt>/dev/urandom</tt>.  
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonRlimit">resource limits</a>   <br>
MLton has functions similar to the C <tt>getrlimit</tt> and <tt>setrlimit</tt> functions. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonRusage">resource usage</a>   <br>
MLton supports a subset of the functionality of the C <tt>getrusage</tt> function. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonSignal">signal handlers</a>   <br>
MLton supports signal handlers written in SML.  Signal handlers run   in a separate MLton thread, and have access to the thread that was   interrupted by the signal.  Signal handlers can be used in   conjunction with threads to implement preemptive multitasking. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonStructure">size primitive</a>   <br>
MLton includes a primitive that returns the size (in bytes) of any object.  This can be useful in understanding the space behavior of a program. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonSyslog">system logging</a>   <br>
MLton has a complete interface to the C <tt>syslog</tt> function. 
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonThread">threads</a>   <br>
MLton has support for its own threads, upon which either preemptive or non-preemptive multitasking can be implemented.  MLton also has support for <a href="ConcurrentML">Concurrent ML</a> (CML).  
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonWeak">weak pointers</a>   <br>
MLton supports weak pointers, which allow the garbage collector to   reclaim objects that it would otherwise be forced to keep.  Weak   pointers are also used to provide finalization.  
</p>
</li>
        <li class="gap">
<p>
 <a href="MLtonWorld">world save and restore</a>   <br>
MLton has a facility for saving the entire state of a computation to a file and restarting it later.  This facility can be used for staging and for checkpointing computations.  It can even be used from within signal handlers, allowing interrupt driven checkpointing. 
</p>
</li>
</ul>

</ul>

</div>



<p>
<hr>
Last edited on 2007-08-24 21:51:26 by <span title="fenrir.uchicago.edu"><a href="MatthewFluet">MatthewFluet</a></span>.
</body></html>
