<div dir="ltr"><div>Hi Csaba,</div><div><br></div><div>The transformations you described already exist as core simplifier passes. For custom compilation, you may write your own pass using the core plugin mechanism, see <a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#compiler-plugins">https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#compiler-plugins</a><br></div><div><br></div><div>It's also possible to perform transformations on STG, but it takes extra effort to retrieve/transform the in-memory STG representations, and type safety is also not guaranteed.<br></div><div><br></div><div>Regards,</div><div>Shao Cheng<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 10, 2018 at 2:51 AM, Csaba Hruska <span dir="ltr"><<a href="mailto:csaba.hruska@gmail.com" target="_blank">csaba.hruska@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><div><div><div><div>Hello,<br><br></div>I wonder what is the easiest way to compile Haskell to supercombinators (top level functions) using GHC as a library.<br><br></div>Is it possible to use GHC simplifier to transform the parsed Haskell source to supercombinators? i.e. to do<br><ul><li>eta expansion</li><li>closure conversion</li><li>lambda lifting<br></li></ul>Or should it be written from scratch?<br></div><br>Is Core or STG suited better for this purpose?<br><br></div>Thanks,<br></div>Csaba<br></div>
<br>______________________________<wbr>_________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a><br>
Only members subscribed via the mailman list are allowed to post.<br></blockquote></div><br></div>