[GHC] #15826: Allow using (Source)Plugins through the GHC API

GHC ghc-devs at haskell.org
Mon Oct 29 02:15:33 UTC 2018


#15826: Allow using (Source)Plugins through the GHC API
-------------------------------------+-------------------------------------
           Reporter:  DanielG        |             Owner:  (none)
               Type:  feature        |            Status:  new
  request                            |
           Priority:  normal         |         Milestone:
          Component:  Compiler       |           Version:  8.7
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 One might expect to be able to load plugins through the GHC API by doing
 something like:

 {{{
 runGHC $ do
   dflags <- getSessionDynFlags
   setSessionDynFlags dflags { plugins = [LoadedPlugin some_plugin
 _conjure_up_modiface []] }
 }}}

 but this doesn't actually work because the `plugins` field in `DynFlags`
 is used as a cache and overwritten by `initializePlugins`  whenever
 plugins loaded through the command-line need reloading. Not to mention
 that there isn't a meaningful way to fill the `_conjure_up_modiface` hole
 AFAIK.

 While in principle it might be possible to use source plugins via the API
 right now by messing with the exposed cmdline flags the right way it feels
 much cleaner to just have a new type of plugin that can be added to GHC
 right through the API.

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


More information about the ghc-tickets mailing list