On 12/05/2011, at 9:23 PM, Simon Marlow wrote:

> On 12/05/2011 07:58, Ben Lippmeier wrote:
>> Hi All,
>> I thought I'd take a moment to mention that the GHC build system is 
>> basically unmaintainable by anyone except the original authors. 

> One day maybe this will all get replaced by something beautiful.  Until then 
> you have to read the docs to undestand how to decode it:

Thanks for the pointers. Another difficulty is that all the rules go into a 
single global namespace, so understanding the interaction is hard, at least for 
me. There's not much in the way of module structure to help get your head 
around it. I suppose that's just how make works though.

Part of my current woes are the undocumented build-race avoiding hacks in DPH, 
which I've spent the last day and a half fighting, so I'm in a fiesty mood.



> If you want some make code that is hard to understand, try this:
> 
> define ap
> $(strip \
> $(if $(findstring $(dollar),$1$2),\
>   $(dollar)$(lpar)call ap$(comma)$1$(comma)$2$(rpar),\
>   $(if $(findstring >>$(lpar)PAP,>>$1),\
>     $(subst $(space)<-TMPSPACE,$(comma),\
>      $(patsubst >>$(lpar)PAP_%,$(dollar)$(lpar)call %$(comma)$2,\
>        >>$(subst $(comma),$(space)<-TMPSPACE,$1))),\
>     $(dollar)$(lpar)call $1$(comma)$2$(rpar))))
> endef
> 
> That's my implementation of combinator reduction in GNU make.

Did you write that as a warm-up for the build system, or just perverse 
curiosity? :-)


We've talked before about the need to bootstrap occasionally, which as I 
understand was one of the reasons for using make. I agree that something like 
Neil's Shake system would be nice if it didn't require a working Haskell 
implementation to build the driver.

I wonder if we could make a sane Haskell DSL to express the build dependencies, 
then flatten this out to a linear shell script for bootstrapping. The plan 
would be that you'd use a pre-built Haskell driver program if you wanted 
parallel builds, but just use the linear shell script for bootstrapping.

I hate working on build systems as much as the next person, but I'm also 
conscious of the fact that the YHC basically died under the weight of its 
broken build system. I don't think that'll happen with GHC, but it is still 
causing me acute pain.

Ben.


_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to