<!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">

<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 20051202</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>
 hppa 
</p>
</li>

            <ul>

            <li>
<p>
 Debian Linux 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 PowerPC 
</p>
</li>

            <ul>

            <li>
<p>
 Darwin (Mac OS X) 
</p>
</li>
            <li>
<p>
 Debian Linux 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 X86:  
</p>
</li>

            <ul>

            <li>
<p>
 <a class="external" href="http://www.cygwin.com"><img src="moin-www.png" alt="[WWW]" height="11" width="11">Cygwin</a>/Windows 
</p>
</li>
            <li>
<p>
 <a class="external" href="http://www.freebsd.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">FreeBSD</a>  
</p>
</li>
            <li>
<p>
 Linux (Debian, Red Hat, ...) 
</p>
</li>
            <li>
<p>
 <a class="external" href="http://mingw.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">MinGW</a>/Windows 
</p>
</li>
            <li>
<p>
 <a class="external" href="http://www.netbsd.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">NetBSD</a> 
</p>
</li>
            <li>
<p>
 <a class="external" href="http://www.openbsd.org"><img src="moin-www.png" alt="[WWW]" height="11" width="11">OpenBSD</a> 
</p>
</li>

            </ul>


        <li class="gap">
<p>
 Sparc 
</p>
</li>

            <ul>

            <li>
<p>
 Debian Linux 
</p>
</li>
            <li>
<p>
 Solaris 
</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>.  
</p>
</li>

        <ul>

  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>. 
        </ul>


    <li class="gap">
<p>
 A complete implementation of the <a href="BasisLibrary">Basis Library</a>. 
</p>
</li>

        <ul>

  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. 
        </ul>


    <li class="gap">
<p>
 Generates standalone executables. 
</p>
</li>

        <ul>

  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. 
        </ul>


    <li class="gap">
<p>
 Compiles large programs. 
</p>
</li>

        <ul>

  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. 
        </ul>


    <li class="gap">
<p>
 Support for large amounts of memory (up to 4G). 
</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. 
</p>
</li>

        <ul>

  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. 
        </ul>


    <li class="gap">
<p>
 Native integers, reals, and words. 
</p>
</li>

        <ul>

  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. 
        </ul>


    <li class="gap">
<p>
 Unboxed native arrays. 
</p>
</li>

        <ul>

  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. 
        </ul>


    <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>.  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>

    </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>
 continuations 
</p>
</li>

            <ul>

   MLton supports continuations via <tt>callcc</tt> and <tt>throw</tt>. 
            </ul>


        <li class="gap">
<p>
 finalization 
</p>
</li>

            <ul>

   MLton supports finalizable values of arbitrary type. 
            </ul>


        <li class="gap">
<p>
 interval timers 
</p>
</li>

            <ul>

   MLton supports the functionality of the C <tt>setitimer</tt> function. 
            </ul>


        <li class="gap">
<p>
 random numbers 
</p>
</li>

            <ul>

   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>.  
            </ul>


        <li class="gap">
<p>
 resource limits 
</p>
</li>

            <ul>

   MLton has functions similar to the C <tt>getrlimit</tt> and <tt>setrlimit</tt> functions. 
            </ul>


        <li class="gap">
<p>
 resource usage 
</p>
</li>

            <ul>

   MLton supports a subset of the functionality of the C <tt>getrusage</tt> function. 
            </ul>


        <li class="gap">
<p>
 signal handlers 
</p>
</li>

            <ul>

   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. 
            </ul>


        <li class="gap">
<p>
 size primitive 
</p>
</li>

            <ul>

   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. 
            </ul>


        <li class="gap">
<p>
 system logging 
</p>
</li>

            <ul>

   MLton has a complete interface to the C <tt>syslog</tt> function. 
            </ul>


        <li class="gap">
<p>
 threads 
</p>
</li>

            <ul>

   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).  
            </ul>


        <li class="gap">
<p>
 weak pointers 
</p>
</li>

            <ul>

   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.  
            </ul>


        <li class="gap">
<p>
 world save and restore 
</p>
</li>

            <ul>

   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. </ul>

</ul>

</ul>

</div>



<p>
<hr>
Last edited on 2005-12-01 04:12:19 by <span title="ppp-71-139-183-221.dsl.snfc21.pacbell.net"><a href="StephenWeeks">StephenWeeks</a></span>.
</body></html>
