[MLton] Serialization?

Stephen Weeks MLton@mlton.org
Tue, 5 Jul 2005 10:01:57 -0700

> I had hoped to have the serialization code completely automatic (I
> mean the 'world' functionality of MLton essentially already does
> this). For myself, I also don't care about mutable values at
> all---so sharing is beside the point. 

Sharing might still be relevant for space savings.  And if you're only
interested in immutable stuff, you might get by with less thought
about the semantics in resurrecting the old serialization code.  But
this doesn't solve your problem with code.

For the code problem, one solution I haven't seen mentioned is for you
to design an embedded language and write an interpreter for it in SML.
Then, you can ship the serializations of programs in your language,
ensuring only that each node has an interpreter.  If your language has
high-level primitives implemented in MLton/SML, hopefully
interpretation speed won't be a problem.  Also, with your own
language, you have control over the capabilities of shipped programs
(no worries about rmdir).