<div dir="ltr">I like this idea, and it overlaps very much with the work that still needs to be done for GHCJSi. I think that for Template Haskell, the restriction that everything has to be marshalled via Binary is not too problematic, although it'd require a bit of care if Richard's pre-proposal to expose more GHC types to TH ( #11081 ) is to be implemented. In particular, the API for querying the type environment would have to remain implementable via message passing, so we can't expose the full TcRn there.<div><br></div><div>compileExpr / dynCompileExpr seem to get some use, perhaps mostly through the hint package:</div><div><br></div><div><a href="http://packdeps.haskellers.com/reverse/hint">http://packdeps.haskellers.com/reverse/hint</a><br><br></div><div>But I think the most common use case is just compiling and running Haskell expressions, without any specific need for interpreted code. The machinery behind hint could be reworked to have the GHC API produce a dynamic library for the compiled expression, which could then be loaded into the current process with the system linker. Or is there some reason that  this approach would be unusable?</div><div><br></div><div>luite<br><br><div class="gmail_quote"><div dir="ltr">On Tue, Nov 17, 2015 at 10:10 AM Simon Marlow <<a href="mailto:marlowsd@gmail.com">marlowsd@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi folks - I've been thinking about changing the way we run interpreted<br>
code so that it would be run in a separate process.  It turns out this<br>
has quite a few benefits, and would let us kill some of the really<br>
awkward hacks we have in GHC to work around problems that arise because<br>
we're running interpreted code and the compiler on the same runtime.<br>
<br>
I summarised the idea here: <a href="https://ghc.haskell.org/trac/ghc/wiki/RemoteGHCi" rel="noreferrer" target="_blank">https://ghc.haskell.org/trac/ghc/wiki/RemoteGHCi</a><br>
<br>
I'd be interested to hear if anyone has any thoughts around this,<br>
particularly if doing this would make your life difficult in some way.<br>
Are people relying on dynCompileExpr for anything?<br>
<br>
Cheers,<br>
Simon<br>
</blockquote></div></div></div>