Changes between Version 6 and Version 7 of Status/Apr10

May 4, 2010 3:02:29 PM (5 years ago)



  • Status/Apr10

    v6 v7  
    77GHC 6.12.2 will also be included in the upcoming Haskell Platform release ( The Haskell platform is the recommended way for end users to get a Haskell development environment. 
    9 == Ongoing work == 
     9=== Ongoing work === 
    1111Meanwhile, in the HEAD, the last 6 months have seen more than 1000 patches pushed from more than a dozen contributors. As the following graph shows, tickets are still being opened faster than we can close them, with the total open tickets growing from around 700 to almost 800. We will be looking in the near future at improving the effectiveness of the way we use the bug tracker. 
    15  * Hoopl and the back end (incl LLVM).  '''Simon PJ'''. 
    16  * Containers: '''Simon PJ and Milan'''. 
    17  * TH quasi-quoting improvements (simpler syntax, types and decls): '''Simon PJ''' 
    18  * Type system generally '''Simon PJ''' 
    19  * Inliner changes (incl CONLIKE) '''Simon PJ''' 
    20  * Data parallel Haskell: '''Manuel''' 
    21  * The [ Threadscope] tool for visualising parallel execution was released.  The tool is ripe for improvement in many ways, if you're interested in helping let us know! 
     16=== Language changes === 
     18We have made a few small language improvements. 
     20Kathleen Fisher suggested two improvements to quasi-quotation: 
     21 * Quasi-quotes can now appear as a top-level declaration, or in a type, as well 
     22   as in a pattern or expression. 
     23 * Quasi-quotes have a less noisy syntax.   
     24Here's an example that illustrates both: 
     26f x = x+1 
     27[pads| ...blah..blah... |] 
     29The second delaration uses the quasi-quoter called `pads` (which must 
     30be in scope) to parse the "...blah..blah..", and return a list of 
     31Template Haskell declarations, which are then spliced into the program 
     32in place of the quote.  
     34== Type system ==  
     36Type families remain the the hottest bit of GHC's type system.  Simon 
     37PJ has been advertising for some months that he intends to completely 
     38rewrite the constraint solver, which forms the heart of the type 
     39inference engine, and that remains the plan although he is being slow 
     40about it.  (The existing constraint solver works surprisingly 
     41well, but we have lots of tickets demonstrating bugs in corner cases.) 
     42An upcoming epic (60-page) JFP paper brings together all the key ideas; 
     43watch Simon's home page. 
     45=== The mighty simplifier === 
     47One of GHC's most crucial optimisers is the Simplifier, which is 
     48reponsible for many local transformations, plus applying inlining and 
     49rewrite-rules.  Over time it had become apparent that the 
     50implementation of INLINE pragmas wasn't very robust: small changes in 
     51the source code, or small wibbles in earlier optimisations, could mean 
     52that something with an INLINE pragma wasn't inlined when it should be, 
     53or vice versa. 
     55Simon PJ therefore completely re-engineered the way INLINE pragmas are 
     58 * GHC now takes a "snapshot" of the original RHS of a function with an INLINE pragma. 
     60 * The function is now optimised as normal, but when the function is 
     61   inlined it is the snapshot, not the current RHS, that is inlined. 
     63 * The function is inlined only when it is applied to as many arguments as the LHS of its original definition.  Consider; 
     65f1, f2 :: Int -> Int -> Int 
     66{-# INLINE f1 #-} 
     67f1 x = \y -> <blah> 
     68{-# INLINE f2 #-} 
     69f2 x y = <blah> 
     71  Here `f1` will be inlined when it is applied to one arugment, but `f2` will only be inlined if it appears applied to two arguments.  This turns out to be helpful in reducing gratuitous code bloat. 
     73Another important related change is this. Consider 
     75{-# RULE "foo" flip (flop x) = <blah> #-} 
     76test x = flip y ++ flip y 
     77  where 
     78    y = flop x 
     80GHC will not fire rule "foo" because it is scared about duplicating the redec 
     81`(flop x)`.  However, if you declare that `flop` is CONLIKE, thus 
     83{-# NOINLINE [1] CONLIKE flop #-} 
     85This declares that an application of `flop` is cheap enough that even a shared  
     86application can participate in a rule application.  The CONLIKE pragma is a modifier 
     87on a NOINLINE (or INLINE) pragma, becuase it really only makes sense to match  
     88`flop` on the LHS of a rule if you know that `flop` is not going to be inlined 
     89before the rule has a chance to fire. 
     92=== The back end === 
     94GHC's back end has been a ferment of activity.  In particular, 
     96  * David Terei made a LLVM back end for GHC [Terei].  It's not part of the HEAD, but we earnestly hope that it will become so. 
     98  * John Dias, Norman Ramsey, and Simon PJ made a lot of progress on Hoopl, our new representaion for control flow graphs, and accompanying functions for dataflow analysis and transformation.  There is a paper [[ Hoopl]], and Hoopl itself is now a standalone, re-usable Cabal package, which makes it much easier for others to use. 
     100The downside is that the code base is in a state of serious flux: 
     101 * We still have two back-end pipelines, because we don't trust the new one to drop the old one.  See [[wiki:Commentary/Compiler/NewCodeGen NewCodeGen]]. 
     102 * We are in the midst of pushing the new Hoopl into GHC. 
     106= Stuff waiting for other people to fill in = 
     108    * Data parallel Haskell: Manuel 
    23112=== Runtime system work (SimonM) === 
    31120The GC has seen some work too: the goal here is to enable each processor ("capability" in the internal terminology) to collect its private heap independently of the other processors.  It turns out that this is quite tricky to achieve in the context of the current architecture, but we have made some progress in this direction by privatising more of the global state and simplifying the GC data structures by removing the concept of "steps", while keeping a simple aging policy which is what steps gave us previously. 
     122== Other miscellaneous stuff == 
     124* GHC makes heavy use of sets and finite maps.  Up till now it has used 
     125  its own home-grown `UniqFM` and `FiniteMap` modules.  Milan Straka (visiting as 
     126  an intern from the Czech Republic) has  
     127  * Made GHC use the `containers` package instead, which happily makes  
     128    compilation go a few percent faster. 
     129  * Developed some improvments to `containers` that makes it go faster still. 
     130    So `UniqFM` and `FiniteMap` are finally dead.  Hurrah for Hackage! 
     132* The [ Threadscope] tool for visualising parallel execution was released.  The tool is ripe for improvement in many ways, if you're interested in helping let us know 
    33134=== Nightly builds === 
    39140We're always keen to add more build slaves; please see if you're interested. Likewise, patches for missing features are welcome! The (Haskell) code is available at 
     142= Bibliography = 
     144 * [Hoopl] "Hoopl: A Modular, Reusable Library for Dataflow Analysis and Transformation", Norman Ramsey, John Dias, and Simon Peyton Jones, submitted to ICFP'10.  [] 
     146 * [Terei] The LLVM back end for GHC [] 
     148 * [NewCodeGen] The glorious new code generator []