next up previous contents
Next: Manual page Up: MLton User Guide Previous: Features of MLton   Contents


Drawbacks of MLton

poor front-end type checking

There is quite a bit of front-end type checking that is not done. If you feed MLton a type-incorrect program, it might produce a terse error message and exit, it might fail to terminate, or it might terminate and produce an executable. Note that this does not mean that the behavior of an executable generated by MLton is random. It simply means that the compiler may behave strangely for invalid SML programs. The behavior of MLton for valid SML programs is well defined.

It is strongly recommended that you type check your programs with another SML compiler before compiling them with MLton.

large run-time memory requirement

MLton's runtime system uses a simple two-space stop-and-copy collector. By default, the runtime system automatically resizes the heap and stack. The collector works well for programs that allocate a lot of ephemeral data, but not so well for programs with large long-lived data. Because of the collector, programs often require more memory than with other SML compilers. There are compile-time and run-time options available to limit the heap usage of programs. See Section 4 for details.

large compile-time memory requirement

Because MLton is self-hosting, when you are compiling using MLton, you are also running a MLton generated executable. Because of the large run-time memory requirement (see above) and the demands of whole-program compilation, the compiler requires a large amount of memory while compiling.

long compile times

Whole-program compilation often takes a long time. For example, compiling the compiler (83K lines) on an 733 MhZ machine takes roughly ten minutes.

no interactive top level

Because of whole-program compilation, MLton does not provide an interactive top level. In particular, it does not implement the use basis library function.


next up previous contents
Next: Manual page Up: MLton User Guide Previous: Features of MLton   Contents