[GHC] #3843: Merge plugins into HEAD

GHC trac at galois.com
Thu Jan 28 04:52:45 EST 2010


#3843: Merge plugins into HEAD
---------------------------------+------------------------------------------
    Reporter:  dreixel           |        Owner:  simonpj     
        Type:  task              |       Status:  new         
    Priority:  normal            |    Milestone:              
   Component:  Compiler          |      Version:  6.13        
    Keywords:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Testcase:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by batterseapower):

 Patch attached. NB: the patch is against a fairly old GHC at this point!

 My original comments with the patch are below this line:

 What's included:
 * Dynamic loading of Core passes
 * -plg command line flag to load plugins
 * -P PluginName:option command line flag to supply options to them
 * Support for using plugins which are not installed in the package DB
 (i.e. I have write a Plugin.hs and use it directly to compile Foo.hs
 in the same directory)
 * Tests for plugin system

 The annotation system and CoreMonad were already merged, so this patch is
 quite manageable.

 I've run the full testsuite against the tree, and there are no additional
 failures compared to HEAD.

 Outstanding issues:
 * Need updated documentation to reflect the new plugins story (no phase
 system). I'll write this if you approve of the new design for how plugins
 get installed.
 * It probably only works on OS X because I'm using Apple linker options to
 export package GHC from the GHC executable. We probably need shared
 library support before it works on Windows and Linux. However, I've
 guessed at some linker options that are suitable for those platforms (see
 ghc-bin), so there is a small possibility it will
 work.

 My two simple example plugins (strict-plugin, cse-plugin - available on
 code.haskell.org) both work correctly. My complex example plugin segfaults
 during compilation, but this has always been true. I am not sure how to
 debug this, and it might be related to my linker hacks. For this reason it
 might be best to merge the plugins patch so I can stop maintaining the
 branch but keep it on the down-low until we find some time to sort this
 out AFTER shared libaries are in.

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


More information about the Glasgow-haskell-bugs mailing list