separate compilation [was Re: Global variables?]

Jon Cast jcast@ou.edu
Wed, 05 Feb 2003 20:05:56 -0600


Andrew J Bromage <ajb@spamcop.net> wrote:
> G'day all.

> On Wed, Feb 05, 2003 at 04:16:33PM -0800, Iavor S. Diatchki wrote:

> > why do you think separate compilation is difficult to achieve in
> > Haskell 98?

> Because of type inference over recursive module imports.  Determining
> the type of a function may, in general, require inferring types from an
> arbitrary number of other modules, and may require inference to occur
> at the level of granularity of a clique in the import graph, rather than
> at the level of a single module.

> Requiring an implementation to perform static analysis a clique at a
> time is not "separate compilation", because changing something which
> is private to one module may in general require an unbounded number of
> other modules to be recompiled, even if inter-module optimisation is
> turned off.

I'm not sure I follow this.  If you change the type of a value exported
from a given module, that's a public change, no?  And if you don't, why
should re-compilation be needed?

<snip>

> Cheers,
> Andrew Bromage

Jon Cast