<div dir="ltr">Theres actually a missing piece of information in this thread: what are the example computations that are being sent?<div style>My understanding is that erlang has not way to send file handles, shared variables, Tvars, Mvars, memory mapped binary files, GPU code / memory pointers , and other fun unportable things between nodes, and I don't really expect / see how we can hope to sanely do that in haskell!  </div>

<div style><br></div><div style>point in fact, even when restricted to "exactly the same binary, running on a cluster of homogeneous machines with the exact same hardware, with a modern linux distro " you hit some gnarly problems doing this for arbitrary closures!  Its for a very simple (and fun) reason: address randomization!   </div>

<div style><br></div><div style>Nathan Howell was actually doing some experimentation with one strategy for this special case here <a href="https://github.com/alphaHeavy/vacuum-tube">https://github.com/alphaHeavy/vacuum-tube</a>  as a deeply rts twiddling bit of hackery so you could in fact "serialize arbitrary closures" between homogeneous machines running the exact same code (and with address randomization disabled too i think)</div>

<div style><br></div><div style>on the GHC API front, <a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/DynamicLoading.html">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/DynamicLoading.html</a> along with (and more appropriately <a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/ObjLink.html">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/ObjLink.html</a> ) should actually give enough basic tooling to make this possible as a userland library, mind you unload was recently fixed up in HEAD by Simon Marlow to support the dynamic code loading / unloading use case he has in facebook.  Point being the GHC 7.8 version of the ObjLink api should actually give enough support tooling to prototype this idea in user land, and that plus better support for writing "direct haskell code" and getting out both a local computation and an AST we can serialize would probably be a good set of primitives for making this feasible in user land.  I </div>

<div style><br></div><div style>The meat of my point is 1) "yes I want this too" but also 2) one thing I really have come to appreciate about how GHC is engineered is a lot of work is done to provide the "right" primitives so that really really great tools can be built in user land.  I think That the goal of this proposal can be accomplished quite nicely with the  ObjLink module, unless i'm not understanding something.  In Fact, because in general not every computation will be properly serializable, you need not even bother with tracking an explicit symbol table on each side, just try to load it at a given type and if it fails it wasn't there!</div>

<div style><br></div><div style>The point being, linkers are a thing, ghc exposes an API for linking, have you tried that api? <a href="http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/ObjLink.html">http://www.haskell.org/ghc/docs/latest/html/libraries/ghc-7.6.3/ObjLink.html</a></div>

<div style><br></div><div style><br></div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 10:21 AM, Brandon Allbery <span dir="ltr"><<a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Tue, Jan 28, 2014 at 7:53 AM, Mathieu Boespflug <span dir="ltr"><<a href="mailto:m@tweag.io" target="_blank">m@tweag.io</a>></span> wrote:<br>

</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="im">On Sat, Jan 25, 2014 at 7:12 PM, Carter Schonwald<br>
<<a href="mailto:carter.schonwald@gmail.com" target="_blank">carter.schonwald@gmail.com</a>> wrote:<br></div><div class="im">> 1) you should (once 7.8 is out) evaluate how far you can push your ideas wrt<br>
> dynamic loading as a user land library.<br>
>  If you can't make it work as a library and can demonstrate why (or how even<br>
> though it works its not quite satisfactory), thats signals something!<br>
<br>
</div></div>Signals what?<br></blockquote><div><br></div><div>That there is a shortcoming in ghc and/or the rts that needs to be addressed.</div><div><br></div></div><div class="im">-- <br><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div>


<div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div>


</div>
</div></div></div>
</blockquote></div><br></div>