<div dir="ltr">On 8 June 2018 at 19:18, Evan Laforge <span dir="ltr"><<a href="mailto:qdunkan@gmail.com" target="_blank">qdunkan@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Jun 8, 2018 at 12:29 AM, Simon Marlow <<a href="mailto:marlowsd@gmail.com">marlowsd@gmail.com</a>> wrote:<br>
> heap profiler for a while. However, I imagine at some point loading<br>
> everything into GHCi will become unsustainable and we'll have to explore<br>
> other strategies. There are a couple of options here:<br>
> - pre-compile modules so that GHCi is loading the .o instead of interpreted<br>
> code<br>
<br>
</span>This is what I do, which is why I was complaining about GHC tending to<br>
break it.  But when it's working, it works well, I load 500+ modules<br>
in under a second.<br>
<span class=""><br>
> - move some of the code into pre-compiled packages, as you mentioned<br>
<br>
</span>I was wondering about the tradeoffs between these two approaches,<br>
compiled modules vs. packages. Compiled modules have the advantage<br>
that you can reload without restarting ghci and relinking a large<br>
library, but no one seems to notice when they break.  Whereas if ghc<br>
broke package loading it would get noticed right away.  Could they be<br>
unified so that, say, -package xyz is equivalent to adding the package<br>
root (with all the .hi and .o files) to the -i list?  I guess the low<br>
level loading mechanism of loading a .so vs. a bunch of individual .o<br>
files is different.<br>
</blockquote></div></div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm slightly surprised that it keeps breaking for you, given that this is a core feature of GHCi and we have multiple tests for it.  You'll need to remind me - what were the bugs specifically? Maybe we need more tests.</div><div class="gmail_extra"><br></div><div class="gmail_extra">There really are fundamental differences in how the compiler treats these two methods though, and I don't see an easy way to reconcile them. Loading object files happens as part of the compilation manager that manages the compilations for all the modules in the current package, whereas packages are assumed to be pre-compiled and are linked on-demand after all the compilation is done.<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Cheers</div><div class="gmail_extra">Simon<br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div></div>