[Haskell-cafe] Re: FRP for game programming / artifical life simulation

Gregory Crosswhite gcross at phys.washington.edu
Wed Apr 28 15:56:31 EDT 2010

On Apr 28, 2010, at 3:41 PM, Limestraël wrote:

> I think the problem with function serialization is that unlike languages which run over a virtual machine, bytecode generated by GHC is platform-specific (just as compilated C or C++) and therefore can run directly on top of the system, which is far faster but less portable.

Is this true?  I thought that ghc has separate machine code and byte-code modes, and inferred that the latter was platform-independent.  Is the latter platform-specific because it is just a different way of organizing different ways of (unlinked) machine code, or because parts of the byte-code depend on things like the size of integers in the compilation machine that are platform-dependent?

Also, it is worth noting that Clean supports serialization of values including closures.  It's not entirely clear to me how they do this, but looks like some combination of seeing whether a referenced routine is already in the current executable, then seeing whether it is in a nearby library, and then finally just-in-type compiling the serialized platform-independent bytecode into native code.


More information about the Haskell-Cafe mailing list