<div dir="ltr"><div><p>Hi Brandon. Thanks for the reply. I’m not sure that it addresses what I was trying to ask. GHCi <em>does</em>
invoke plugins and even reloads those plugins dynamically when their
source code changes. So in this sense ghci does enable optimization,
even if it doesn’t perform much optimization on its own. And of course
plugins and unfolding are not just about optimization.</p>
<p>I’m not looking for ghci to do optimization, but rather to enable me to more easily develop my GHC plugins. It’s <em>almost</em> there already. I just need access to unfoldings from other modules for my plugin’s use.</p>
<p>For context, I’m rebuilding my <a href="https://github.com/conal/talk-2015-haskell-to-hardware">Haskell-to-hardware compiler</a>,
which relies on giving a non-standard but principled interpretation of
Haskell programs via a conversion through the language of cartesian
closed categories (CCCs). The first back-end is hardware generation
(e.g., via Verilog), and I have plans for several other CCC-based
interpretations.</p>
<p>In addition to facilitating my plugin development, hosting in ghci will make it much more pleasant for others to <em>use</em>
the plugin during exploratory programming, just as with ghci use in
general. With access to unfoldings, users will be able to generate
circuit diagrams and Verilog like those in my compiler talk immediately
and directly from within ghci. I also intend to make a GPU back-end for
fast interactive graphics etc, which would be much more fun in ghci than
with batch compilation.</p>
I hope this explanation clarifies my goals and motivation. I hope
there’s a way to access unfoldings from ghci currently or with a small
amount of effort.<br><br></div>Regards, - Conal<br><div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 17, 2016 at 7:00 PM, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><span class=""><div class="gmail_quote">On Sun, Jan 17, 2016 at 9:40 PM, Conal Elliott <span dir="ltr"><<a href="mailto:conal@conal.net" target="_blank">conal@conal.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I'm developing a GHC plugin (using HERMIT), and I'd like to use ghci to speed up development. I'm able to do so, except that my plugin critically needs access to unfoldings, which appear to be unavailable in ghci. A little experimenting with ghc shows me that "-O" is the key, but "-O" is incompatible with "--interactive" (as in ghci). Is there any way to persuade ghci to make unfoldings available?</blockquote></div><br></span>I think unfoldings are only done as part of optimization, and the bytecode backend doesn't support optimization at all.<span class=""><font color="#888888"><br clear="all"><div><br></div>-- <br><div><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>
</font></span></div></div>
</blockquote></div><br></div></div></div>