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.

Cheers,
Greg

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to