Template Haskell and stage-1

Ian Lynagh igloo at earth.li
Wed Nov 6 17:12:40 UTC 2013


On Wed, Nov 06, 2013 at 01:43:02PM +0000, Simon Peyton-Jones wrote:
> I'd like to make -XtemplateHaskell simply illegal in a stage-1 compiler. After all, it is!
> But for some reason we use the stage1 compiler to generate dependencies for the DPH libraries; those libraries have {-# LANGUAGE TemplateHaskell #-}, so the dependency generation fails.  See below.
> But WHY do we generate deps for DPH with stage1?  We don't *compile* the DPH libraries with stage1, because they need TH.  Can't we just generate deps with stage2?

It's due to the build system phases:
http://ghc.haskell.org/trac/ghc/wiki/Building/Architecture/Idiom/PhaseOrdering#GHCsphases

Stage2 doesn't exist during the phase in which DPH is configured.
Changing it to use stage 2 would probably mean adding another phase for
things that need to be configured by stage 2. This might mean slower
builds due to loss of parallelism, I'm not sure.

Perhaps the decision to build DPH with the GHC build system should be
revisited? It causes some complication, and it seems that more and more
people are disabling it anyway, in order to get faster builds.


Thanks
Ian



More information about the ghc-devs mailing list