[Haskell-cafe] Cyclic Inclusions

ajb at spamcop.net ajb at spamcop.net
Wed Aug 13 07:18:01 EDT 2008


G'day all.

Quoting Thomas Davie <tom.davie at gmail.com>:

> To be honest, ghc compiles things so fast (at least on any of
> my systems) that I couldn't care less if it took 10 times as long (I would
> however like some added convenience for that time spent)

Have you ever compiled GHC itself?  Just curious what you'd think about
a 10x speed hit there.

If it helps, think about the lifetime of a program.  If you assume that
a program grows linearly over time, and that recompilations occur at
a roughly constant rate, it follows that the time spent recompiling
is O(n^2).  Constant factors matter.

> If I compile a module on which lots of other modules depend,
> I have to do lots of recompilation... If I compile a module which is in
> a cyclic dependancy group, I have to do lots of recompilation,  I don't
> see that there's a difference here.

If you only change the implementation of a module, not its interface,
you don't need to recompile anything that imports it.  (At least, this
is true at -O0, which if you care about fast recompilation because
you're deep in development, you're probably doing.)

> That's a fair point about programming style, otoh, I don't think it's a
> reason to restrict users to not using cyclic dependancies.

As previously noted, cyclic dependencies alone aren't the problem.

Cheers,
Andrew Bromage


More information about the Haskell-Cafe mailing list