| 1 | History |
| 2 | ======= |
| 3 | |
| 4 | In April 1997, Stephen Weeks wrote a defunctorizer for Standard ML and |
| 5 | integrated it with SML/NJ. The defunctorizer used SML/NJ's visible |
| 6 | compiler and operated on the `Ast` intermediate representation |
| 7 | produced by the SML/NJ front end. Experiments showed that |
| 8 | defunctorization gave a speedup of up to six times over separate |
| 9 | compilation and up to two times over batch compilation without functor |
| 10 | expansion. |
| 11 | |
| 12 | In August 1997, we began development of an independent compiler for |
| 13 | SML. At the time the compiler was called `smlc`. By October, we had |
| 14 | a working monomorphiser. By November, we added a polyvariant |
| 15 | higher-order control-flow analysis. At that point, MLton was about |
| 16 | 10,000 lines of code. |
| 17 | |
| 18 | Over the next year and half, `smlc` morphed into a full-fledged |
| 19 | compiler for SML. It was renamed MLton, and first released in March |
| 20 | 1999. |
| 21 | |
| 22 | From the start, MLton has been driven by whole-program optimization |
| 23 | and an emphasis on performance. Also from the start, MLton has had a |
| 24 | fast C FFI and `IntInf` based on the GNU multiprecision library. At |
| 25 | its first release, MLton was 48,006 lines. |
| 26 | |
| 27 | Between the March 1999 and January 2002, MLton grew to 102,541 lines, |
| 28 | as we added a native code generator, mllex, mlyacc, a profiler, many |
| 29 | optimizations, and many libraries including threads and signal |
| 30 | handling. |
| 31 | |
| 32 | During 2002, MLton grew to 112,204 lines and we had releases in April |
| 33 | and September. We added support for cross compilation and used this |
| 34 | to enable MLton to run on Cygwin/Windows and FreeBSD. We also made |
| 35 | improvements to the garbage collector, so that it now works with large |
| 36 | arrays and up to 4G of memory and so that it automatically uses |
| 37 | copying, mark-compact, or generational collection depending on heap |
| 38 | usage and RAM size. We also continued improvements to the optimizer |
| 39 | and libraries. |
| 40 | |
| 41 | During 2003, MLton grew to 122,299 lines and we had releases in March |
| 42 | and July. We extended the profiler to support source-level profiling |
| 43 | of time and allocation and to display call graphs. We completed the |
| 44 | Basis Library implementation, and added new MLton-specific libraries |
| 45 | for weak pointers and finalization. We extended the FFI to allow |
| 46 | callbacks from C to SML. We added support for the Sparc/Solaris |
| 47 | platform, and made many improvements to the C code generator. |