Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | Features |
2 | ======== | |
3 | ||
4 | MLton has the following features. | |
5 | ||
6 | == Portability == | |
7 | ||
8 | * Runs on a variety of platforms. | |
9 | ||
10 | ** <:RunningOnARM:ARM>: | |
11 | *** <:RunningOnLinux:Linux> (Debian) | |
12 | ||
13 | ** <:RunningOnAlpha:Alpha>: | |
14 | *** <:RunningOnLinux:Linux> (Debian) | |
15 | ||
16 | ** <:RunningOnAMD64:AMD64>: | |
17 | *** <:RunningOnDarwin:Darwin> (Mac OS X) | |
18 | *** <:RunningOnFreeBSD:FreeBSD> | |
19 | *** <:RunningOnLinux:Linux> (Debian, Fedora, Ubuntu, ...) | |
20 | *** <:RunningOnOpenBSD:OpenBSD> | |
21 | *** <:RunningOnSolaris:Solaris> (10 and above) | |
22 | ||
23 | ** <:RunningOnHPPA:HPPA>: | |
24 | *** <:RunningOnHPUX:HPUX> (11.11 and above) | |
25 | *** <:RunningOnLinux:Linux> (Debian) | |
26 | ||
27 | ** <:RunningOnIA64:IA64>: | |
28 | *** <:RunningOnHPUX:HPUX> (11.11 and above) | |
29 | *** <:RunningOnLinux:Linux> (Debian) | |
30 | ||
31 | ** <:RunningOnPowerPC:PowerPC>: | |
32 | *** <:RunningOnAIX:AIX> (5.2 and above) | |
33 | *** <:RunningOnDarwin:Darwin> (Mac OS X) | |
34 | *** <:RunningOnLinux:Linux> (Debian, Fedora, ...) | |
35 | ||
36 | ** <:RunningOnPowerPC64:PowerPC64>: | |
37 | *** <:RunningOnAIX:AIX> (5.2 and above) | |
38 | ||
39 | ** <:RunningOnS390:S390> | |
40 | *** <:RunningOnLinux:Linux> (Debian) | |
41 | ||
42 | ** <:RunningOnSparc:Sparc> | |
43 | *** <:RunningOnLinux:Linux> (Debian) | |
44 | *** <:RunningOnSolaris:Solaris> (8 and above) | |
45 | ||
46 | ** <:RunningOnX86:X86>: | |
47 | *** <:RunningOnCygwin:Cygwin>/Windows | |
48 | *** <:RunningOnDarwin:Darwin> (Mac OS X) | |
49 | *** <:RunningOnFreeBSD:FreeBSD> | |
50 | *** <:RunningOnLinux:Linux> (Debian, Fedora, Ubuntu, ...) | |
51 | *** <:RunningOnMinGW:MinGW>/Windows | |
52 | *** <:RunningOnNetBSD:NetBSD> | |
53 | *** <:RunningOnOpenBSD:OpenBSD> | |
54 | *** <:RunningOnSolaris:Solaris> (10 and above) | |
55 | ||
56 | == Robustness == | |
57 | ||
58 | * Supports the full SML 97 language as given in <:DefinitionOfStandardML:The Definition of Standard ML (Revised)>. | |
59 | + | |
60 | If there is a program that is valid according to the | |
61 | <:DefinitionOfStandardML:Definition> that is rejected by MLton, or a | |
62 | program that is invalid according to the | |
63 | <:DefinitionOfStandardML:Definition> that is accepted by MLton, it is | |
64 | a bug. For a list of known bugs, see <:UnresolvedBugs:>. | |
65 | ||
66 | * A complete implementation of the <:BasisLibrary:Basis Library>. | |
67 | + | |
68 | MLton's implementation matches latest <:BasisLibrary:Basis Library> | |
69 | http://www.standardml.org/Basis[specification], and includes a | |
70 | complete implementation of all the required modules, as well as many | |
71 | of the optional modules. | |
72 | ||
73 | * Generates standalone executables. | |
74 | + | |
75 | No additional code or libraries are necessary in order to run an | |
76 | executable, except for the standard shared libraries. MLton can also | |
77 | generate statically linked executables. | |
78 | ||
79 | * Compiles large programs. | |
80 | + | |
81 | MLton is sufficiently efficient and robust that it can compile large | |
82 | programs, including itself (over 190K lines). The distributed version | |
83 | of MLton was compiled by MLton. | |
84 | ||
85 | * Support for large amounts of memory (up to 4G on 32-bit systems; more on 64-bit systems). | |
86 | ||
87 | * Support for large array lengths (up to 2^31^-1 on 32-bit systems; up to 2^63^-1 on 64-bit systems). | |
88 | ||
89 | * Support for large files, using 64-bit file positions. | |
90 | ||
91 | == Performance == | |
92 | ||
93 | * Executables have <:Performance:excellent running times>. | |
94 | ||
95 | * Generates small executables. | |
96 | + | |
97 | MLton takes advantage of whole-program compilation to perform very | |
98 | aggressive dead-code elimination, which often leads to smaller | |
99 | executables than with other SML compilers. | |
100 | ||
101 | * Untagged and unboxed native integers, reals, and words. | |
102 | + | |
103 | In MLton, integers and words are 8 bits, 16 bits, 32 bits, and 64 bits | |
104 | and arithmetic does not have any overhead due to tagging or boxing. | |
105 | Also, reals (32-bit and 64-bit) are stored unboxed, avoiding any | |
106 | overhead due to boxing. | |
107 | ||
108 | * Unboxed native arrays. | |
109 | + | |
110 | In MLton, an array (or vector) of integers, reals, or words uses the | |
111 | natural C-like representation. This is fast and supports easy | |
112 | exchange of data with C. Monomorphic arrays (and vectors) use the | |
113 | same C-like representations as their polymorphic counterparts. | |
114 | ||
115 | * Multiple <:GarbageCollection:garbage collection> strategies. | |
116 | ||
117 | * Fast arbitrary precision arithmetic (`IntInf`) based on <:GnuMP:>. | |
118 | + | |
119 | For `IntInf` intensive programs, MLton can be an order of magnitude or | |
120 | more faster than Poly/ML or SML/NJ. | |
121 | ||
122 | == Tools == | |
123 | ||
124 | * Source-level <:Profiling:> of both time and allocation. | |
125 | * <:MLLex:> lexer generator | |
126 | * <:MLYacc:> parser generator | |
127 | * <:MLNLFFIGen:> foreign-function-interface generator | |
128 | ||
129 | == Extensions == | |
130 | ||
131 | * A simple and fast C <:ForeignFunctionInterface:> that supports calling from SML to C and from C to SML. | |
132 | ||
133 | * The <:MLBasis:ML Basis system> for programming in the very large, separate delivery of library sources, and more. | |
134 | ||
135 | * A number of extension libraries that provide useful functionality | |
136 | that cannot be implemented with the <:BasisLibrary:Basis Library>. | |
137 | See below for an overview and <:MLtonStructure:> for details. | |
138 | ||
139 | ** <:MLtonCont:continuations> | |
140 | + | |
141 | MLton supports continuations via `callcc` and `throw`. | |
142 | ||
143 | ** <:MLtonFinalizable:finalization> | |
144 | + | |
145 | MLton supports finalizable values of arbitrary type. | |
146 | ||
147 | ** <:MLtonItimer:interval timers> | |
148 | + | |
149 | MLton supports the functionality of the C `setitimer` function. | |
150 | ||
151 | ** <:MLtonRandom:random numbers> | |
152 | + | |
153 | MLton has functions similar to the C `rand` and `srand` functions, as well as support for access to `/dev/random` and `/dev/urandom`. | |
154 | ||
155 | ** <:MLtonRlimit:resource limits> | |
156 | + | |
157 | MLton has functions similar to the C `getrlimit` and `setrlimit` functions. | |
158 | ||
159 | ** <:MLtonRusage:resource usage> | |
160 | + | |
161 | MLton supports a subset of the functionality of the C `getrusage` function. | |
162 | ||
163 | ** <:MLtonSignal:signal handlers> | |
164 | + | |
165 | MLton supports signal handlers written in SML. Signal handlers run in | |
166 | a separate MLton thread, and have access to the thread that was | |
167 | interrupted by the signal. Signal handlers can be used in conjunction | |
168 | with threads to implement preemptive multitasking. | |
169 | ||
170 | ** <:MLtonStructure:size primitive> | |
171 | + | |
172 | MLton includes a primitive that returns the size (in bytes) of any | |
173 | object. This can be useful in understanding the space behavior of a | |
174 | program. | |
175 | ||
176 | ** <:MLtonSyslog:system logging> | |
177 | + | |
178 | MLton has a complete interface to the C `syslog` function. | |
179 | ||
180 | ** <:MLtonThread:threads> | |
181 | + | |
182 | MLton has support for its own threads, upon which either preemptive or | |
183 | non-preemptive multitasking can be implemented. MLton also has | |
184 | support for <:ConcurrentML:Concurrent ML> (CML). | |
185 | ||
186 | ** <:MLtonWeak:weak pointers> | |
187 | + | |
188 | MLton supports weak pointers, which allow the garbage collector to | |
189 | reclaim objects that it would otherwise be forced to keep. Weak | |
190 | pointers are also used to provide finalization. | |
191 | ||
192 | ** <:MLtonWorld:world save and restore> | |
193 | + | |
194 | MLton has a facility for saving the entire state of a computation to a | |
195 | file and restarting it later. This facility can be used for staging | |
196 | and for checkpointing computations. It can even be used from within | |
197 | signal handlers, allowing interrupt driven checkpointing. |