Marshalling functions was: Transmitting Haskell values

Joachim Durchholz joachim.durchholz at
Wed Oct 29 02:55:00 EST 2003

Dimitry Golubovsky wrote:
> Well, marshalling functions (or storing-restoring some internal forms
> of them) might be especially nice... This would mean I can declare
> and compile a function on my side of a network connection (for
> example), and then send it to the other end for evaluation, and then
> get the result. Like a database request.

I've got a different and (IMHO) more interesting application: upgrading
code on the other side of a network.
Application startup would be downloading updates from the server, then
loading all the code from disk.

> Is this something absolutely impossible in Haskell and by what
> reason? Just because of strong typing (forgive my stupidity ;)? Or
> are there some deeper theoretical limitations?

No theoretical limitations but practical ones. AFAIK, dynamic code 
loading has issues with garbage collection and global optimization - 
it's certainly doable and some languages do it, but it's nontrivial and 
certainly a lot of work.

I'd like to have it anyway :-)
But I'm not going to hold my breath for it; it's probably more prudent 
to try things with the currently available mechanisms (that is, 
Show/Read and Binary).


More information about the Glasgow-haskell-users mailing list