On Thu, Aug 22, 2013 at 6:13 PM, Simon Peyton-Jones <simonpj@microsoft.com> wrote:

Luite, Edsko, Thomas, Nicolas

 

You have all variously proposed improvements to the GHC API and/or the plug-in mechanism.  I have been so swamped in the last few months that I have not had a chance to look carefully at your proposals, nor how they relate to each other.

 


Edsko's source plugins are similar to Hooks, adding some functions to customize things through DynFlags. Unfortunately, adding things to DynFlags makes DynFlags depend on them, which severely limits extensibility of source plugins (already evidenced by Edsko's implementation using (forall m. MonadIO m => constraints for the plugins, instead of the actual RnM and Hsc monads in which they're always run)

Hooks adds an indirection to avoid this. I've implemented Edsko's source plugins patch in terms of hooks in the latest update.

I think the RunPhaseHook already does much of what Thomas needs, perhaps he also needs something for hscParse / hscSimplify (both just a few lines change).


luite

The plugins from Edsko's patch as hooks:
RunQuasiQuoterHook: https://github.com/ghcjs/ghcjs-build/blob/f0147ed8b588151461557b0a8440581c4d36c9ec/refs/patches/ghc-ghcjs.patch#L1440
HscFrontendHook: https://github.com/ghcjs/ghcjs-build/blob/f0147ed8b588151461557b0a8440581c4d36c9ec/refs/patches/ghc-ghcjs.patch#L740

How to use:
https://gist.github.com/luite/6312097