RE: Global variables?

| Haskell 98 has never supported separate compilation. That's why we | have hi-boot files (or something similar). | | So, yes, I'd like to know how the language designers intend to support | separate compilation in the next version. H98 has nothing to say about the separate compilation; it's an issue for the implementation. GHC does separate compilation for Haskell, and always has done. It requires the programmer to supply an auxiliary hi-boot file for one module in each mutually recursive group (and, of course, none if there is no recursion between modules). Simon

On 05-Feb-2003, Simon Peyton-Jones
| Haskell 98 has never supported separate compilation. That's why we | have hi-boot files (or something similar). | | So, yes, I'd like to know how the language designers intend to support | separate compilation in the next version.
H98 has nothing to say about the separate compilation; it's an issue for the implementation. GHC does separate compilation for Haskell, and always has done. It requires the programmer to supply an auxiliary hi-boot file for one module in each mutually recursive group (and, of course, none if there is no recursion between modules).
In other words, GHC doesn't support separate compilation of
Haskell 98 -- it supports separate compilation of a closely related
but distinct language which we can call "Haskell 98 + GHC hi-boot files".
--
Fergus Henderson

G'day.
On 05-Feb-2003, Simon Peyton-Jones
H98 has nothing to say about the separate compilation; it's an issue for the implementation.
H98 indeed says nothing about separate compilation, and it is indeed an issue for the implementation. What H98 does is it defines a language for which separate compilation is at best extremely difficult and at worst virtually impossible without extra information which is not part of H98 (such as GHC's hi-boot files). On Wed, Feb 05, 2003 at 07:41:52PM +1100, Fergus Henderson wrote:
In other words, GHC doesn't support separate compilation of Haskell 98 -- it supports separate compilation of a closely related but distinct language which we can call "Haskell 98 + GHC hi-boot files".
Exactly. Cheers, Andrew Bromage

hello, Andrew J Bromage wrote:
... What H98 does is it defines a language for which separate compilation is at best extremely difficult and at worst virtually impossible without extra information which is not part of H98 (such as GHC's hi-boot files). ...
why do you think separate compilation is difficult to achieve in Haskell 98? as simon pointed out, GHC does it and has been doing it for a long time. dealing with mutually recusrive modules is i think a separate issue. even though GHC doesn't quite do it, it is certainly possible, and not very difficult to do. in fact we have it implemented in one of the projects i am currently working on. hopefully one day GHC will also dispense with the hi-boot files. bye iavor -- ================================================== | Iavor S. Diatchki, Ph.D. student | | Department of Computer Science and Engineering | | School of OGI at OHSU | | http://www.cse.ogi.edu/~diatchki | ==================================================

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.
as simon pointed out, GHC does it and has been doing it for a long time.
GHC does separate compilation by requiring the programmer to step outside H98, by writing GHC-specific hi-boot files. I agree that GHC therefore supports separate compilation, but, as Fergus pointed out, it does not support separate compilation within H98.
dealing with mutually recusrive modules is i think a separate issue.
Why is it a separate issue?
even though GHC doesn't quite do it, it is certainly possible, and not very difficult to do. in fact we have it implemented in one of the projects i am currently working on. hopefully one day GHC will also dispense with the hi-boot files.
I would certainly like to see this, but it doesn't fix the concern noted above, that changing something private to one module may cause an arbitrary number of other modules to be recompiled. That is not "separate compilation" by any definition of the word "separate" that I am aware of. Cheers, Andrew Bromage

G'day all. I noticed a mistake. On Thu, Feb 06, 2003 at 11:42:21AM +1100, Andrew J Bromage wrote:
Because of type inference over recursive module imports.
I meant to say _transitive_ module imports, which includes recursive module imports. Cheers, Andrew Bromage
participants (4)
-
Andrew J Bromage
-
Fergus Henderson
-
Iavor S. Diatchki
-
Simon Peyton-Jones