serialization

Stephen Weeks sweeks@wasabi.epr.com
Mon, 2 Aug 1999 13:15:07 -0700 (PDT)


> What is the idea behind serialization?  I assume that it won't work between
> different programs.

Actually, I was overstating the case a bit there.  It should work fine
as long as you stick with built in types: char, int, ..., 'a vector,
'a array, 'a * 'b (where 'a and 'b are built in).  Although MLton
makes no guarantee that these will be represented the same across
different programs, at present, they are.

But mostly I was thinking of two cases:

* The same application running on different machines (think games).
  To do this, it would be easy to adopt a single type of "message" to
  be sent which is a sum type of all of the desired messages to be 
  sent.  Now that I have serialization working for -> types and
  continuations, process migration is really easy too.

* One application running on a machine and communicating with its
  fork'd descendents via pipes.  I was thinking that this could be
  used to implement a variant of CML that has *no* shared memory and
  only communicates via channels.  Or at least it would allow some 
  kind of structured communication between subprocesses, possibly
  useful for writing gui's?