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

 * cc: mad....@… (added)


Comment:

 I have taken the liberty of updating Max's patch to work with the latest
 GHC HEAD (7.1.x at time of this writing) after talking with him.

 It is implemented in the following patch:

 {{{
 Fri Nov 19 18:44:58 CST 2010  austin seipp <[email protected]>
   * Implement support for writing and loading plugins for GHC
   Based on Max Bolingbroke's original patch for implementing plugin
 support in GHC,
   which can be gotten from here:
 http://hackage.haskell.org/trac/ghc/ticket/3843

   A little bit of the linker interface changed and the simplifier
 interface changed
   inbetween now and then. This patch brings most of the work Max did up to
 date although
   there may be a few loose ends. The interface for plugins that rewrite
 core hasn't changed
   (that is, most people will be writing passes of type [CoreBind] -> CoreM
 [CoreBind])

   Plugins are registered the same way as they were previously: plugin
 modules provide an installation
   function of type [CoreToDo] -> CoreM [CoreToDo]

   Changes:
    * -plg and -P flags replaced by -fplugin and -fplugin-arg (consistent
 with what GCC uses)


     M ./compiler/basicTypes/Module.lhs -1 +3
     M ./compiler/ghc.cabal.in +4
     M ./compiler/ghci/Linker.lhs -2 +39
     M ./compiler/main/DynFlags.hs -1 +24
     A ./compiler/main/DynamicLoading.hs
     A ./compiler/main/GHCPlugins.hs
     A ./compiler/main/LoadPlugins.lhs
     A ./compiler/main/Plugins.lhs
     A ./compiler/main/Plugins.lhs-boot
     M ./compiler/prelude/PrelNames.lhs -1 +20
     M ./compiler/simplCore/CoreMonad.lhs -1 +26
     M ./compiler/simplCore/SimplCore.lhs -3 +39
 }}}

 I currently haven't ported over the patches Max made to the testsuite,
 although with the above patch you can use my slightly modified version of
 Max's CSE plugin, which can be found here:

 https://github.com/thoughtpolice/cse-ghc-plugin

 It seems to work as expected.

 Patch will be attached. I will continue to update this with patches for
 fixes and eventually the testsuite programs. I am willing to help maintain
 this functionality and make improvements fixes, essentially because I want
 to see it finally.merged into GHC mainline. It is early in the development
 cycle for GHC 7.2, so it would be wonderful if we could get it merged
 early so there is time to make changes and fix bugs for a while.

 Later on perhaps, I would like to extend the Plugins functionality to
 encompass writing Cmm plugins and perhaps inevitably new backends (after
 the new integrated code generator lands,) although that will require
 design on my part and input from many people (I would however, like to get
 this merged soon!)

 Comments welcome.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3843#comment:10>
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

Reply via email to