Looks simple enough in principle.<div><br></div><div>This patch only implements hooking, although I agree with your original email that this would also be useful externally (with -fplugin.) However, the core plugin mechanism is the opposite: it only has an external interface, but I&#39;m unsure if there&#39;s a similarly easy way to fiddle with the core pipeline, using only the GHC API. Adding it to dynflags like you did would be OK (barring other peoples&#39; objections.)</div>
<div><br></div><div>So with that in mind, should we maybe take this time to consolidate the two APIs a bit for coherency? Just a thought.<span></span><br><br>On Monday, July 8, 2013, Edsko de Vries  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Ok, sorry all for the delay. Attached is a &quot;frontend plugins&quot; patch for ghc 7.4.2. It will not work for ghc HEAD because the structure of the compiler has changed in various places, but I cannot currently compile my code against HEAD. Making this available now because it&#39;s been far too long already :) Comments/suggestions/feedback welcome. Hopefully the patch is pretty self-explanatory; and it&#39;s only small.<div>

<br></div><div>-E</div></div><div><br><br><div>On Mon, Jul 1, 2013 at 9:32 AM, Edsko de Vries <span dir="ltr">&lt;<a>edskodevries@gmail.com</a>&gt;</span> wrote:<br>
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, I fully intend to create a ticket with a detailed description and a first patch, but I&#39;ve been struggling with the latest HEAD, and specifically the fact that it now uses dynamic libraries for TH. I (think I am) stuck at a Cabal bug and I cannot currently build my code at all :-/ Duncan is looking into this though.<span><font color="#888888"><div>


<br></div><div>Edsko</div></font></span></div><div><div><div><br><br><div>On Fri, Jun 28, 2013 at 1:43 PM, Simon Peyton-Jones <span dir="ltr">&lt;<a>simonpj@microsoft.com</a>&gt;</span> wrote:<br>

<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I’m confused as to details here. 
<u></u><u></u></span></p>
<p><u></u><span style="font-size:11.0pt;font-family:Symbol;color:#1f497d"><span>·<span style="font:7.0pt &quot;Times New Roman&quot;">        
</span></span></span><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Edsko is doing something; Nick is doing something else (attached for completeness).<u></u><u></u></span></p>



<p><u></u><span style="font-size:11.0pt;font-family:Symbol;color:#1f497d"><span>·<span style="font:7.0pt &quot;Times New Roman&quot;">        
</span></span></span><u></u><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I can’t locate a Trac Wiki page that describes the design<u></u><u></u></span></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">I’m more than happy to adopt patches that improve the plugin API, but you’ll have to lead me through it!<u></u><u></u></span></p>



<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">No hurry, just when you are ready.<u></u><u></u></span></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d">Simon<u></u><u></u></span></p>
<p><span style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p><b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;"> Edsko de Vries [mailto:<a>edskodevries@gmail.com</a>]
<br>
<b>Sent:</b> 26 June 2013 09:21<br>
<b>To:</b> Luite Stegeman<br>
<b>Cc:</b> Simon Peyton-Jones; Thomas Schilling; <a>ghc-devs@haskell.org</a></span></p><div><div><br>
<b>Subject:</b> Re: Patch/feature proposal: &quot;Source plugins&quot;<u></u><u></u></div></div><p></p>
</div>
</div><div><div>
<p><u></u> <u></u></p>
<div>
<p style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Hi Luite,<u></u><u></u></p>
<div>
<p style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
I was fully planning on a first version of the patch yesterday, but so far my efforts were thwarted by annoying problems with dynamic libraries (not -- directly -- related to the patch at all). I will try again today :)<u></u><u></u></p>



</div>
<div>
<p style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
<div>
<p style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Edsko<u></u><u></u></p>
</div></div></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div></blockquote></div><br><br>-- <br>Sent from my portable turning machine<br>