[GHC] #14709: Extend the plugin mechanism to access program representation

GHC ghc-devs at haskell.org
Mon Jan 29 01:02:34 UTC 2018


#14709: Extend the plugin mechanism to access program representation
-------------------------------------+-------------------------------------
        Reporter:  lazac             |                Owner:  (none)
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  GHC API           |              Version:  8.2.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |  https://phabricator.haskell.org/D4342
  https://ghc.haskell.org/trac/ghc/wiki/ExtendedPluginsProposal|
-------------------------------------+-------------------------------------

Comment (by lazac):

 Your tutorial is very useful, I also tried it when I was experimenting of
 using frontend plugins for the same problem that I would like to solve
 with the source plugins.

 I think it is possible to extract the typechecked AST with a frontend
 plugin and a wrapper program setting up the frontend compiler hook.
 However for my tool I need other information, including loaded interfaces,
 renamed AST and splices evaluated. I think other tool developers will find
 the availability of those useful as well.

 From a design perspective, I would like to extend GHC in a way that
 doesn't alter the compilation process, and I think that normal plugins are
 better for that than frontend plugins. It is also generally easier to
 setup the build system to use a few compiler flags than to use a different
 compiler, and the user will not have problems if he has more than one GHC
 installed.

 Overall you are right in that the wiki page oversimplifies the matter, I
 will try to improve it. Thank for pointing out!

-- 
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14709#comment:8>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list