[MLton] MLton import headers

Vesa Karvonen vesa.a.j.k at gmail.com
Fri Oct 3 14:28:26 PDT 2008


On Fri, Oct 3, 2008 at 11:21 PM, Matthew Fluet <fluet at tti-c.org> wrote:
> Finally, importing a MLton library (either static or dynamic) into another
> MLton library or executable seems to be a fairly obscure usage. [...]

I could certainly imagine some more or less plausible practical
reasons to do so, such as cutting compilation time. Although, given
the limited set of types available for interfacing with such
libraries, many such uses could just as well be written by compiling
the MLton "library" as a regular program that is spawned by the host
program as a separate process and communicated with via some form of
IPC. BTW, according to Armstrong's book this is a preferred way of
using foreign language libraries in Erlang.

> It is almost certainly a win to have all high-level language code sharing
> the same instance of the runtime/GC/etc.

Yes, if you are directly linking to the code, then I would tend to
agree (modulo exceptional practical concerns).  Isolating parts of a
program to different processes, OTOH, may have practical advantages
such as fault isolation (bug in a subsystem cannot crash the entire
program) that can be more valuable than efficiency.

-Vesa Karvonen



More information about the MLton mailing list