#5941: Add compilation stage plugins
------------------------------+---------------------------------------------
Reporter: tibbe | Owner:
Type: feature request | Status: new
Priority: normal | Component: Compiler
Version: 7.4.1 | Keywords:
Os: Unknown/Multiple | Architecture: Unknown/Multiple
Failure: None/Unknown | Testcase:
Blockedby: | Blocking:
Related: |
------------------------------+---------------------------------------------
There are several different tools that could be written using one of GHC's
intermediate ASTs, like the post type-checking `HsSyn Id`. These can today
be written as separate programs, using the GHC API. An example of such a
program would be a CTAGS-on-steroids tool that would let you, as part of
compilation, output a file containing all the names in the program,
together with their source locations and types. This file could then be
used to implement a type and qualified names aware grep.
However, compiling every file twice, once normally and once using this
hypothetical tool, just to get that additional output file, is wasteful.
It would be better if we could specify a plugin that would run at one of a
few well defined places in the pipeline e.g. after renaming or type
checking. Those plugins could be passed the data structures (e.g. `HsSyn
Id`) created by GHC and then perform some arbitrary action (e.g. write to
a file or modify the AST.)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5941>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs