
Johannes Waldmann writes:
This leads to another question - during the linking stage: when should the compilation manager look for a single object file, and when should it expect an archive?
I'll explain briefly how GHC would handle this. GHC has a concept of a "package", which is basically a compiled unit consisting of libraries and interfaces (not necessarily Haskell). For each package, the compiler has a specification telling it what the interface search path for this package is, what the libraries are called (and where they live), and what other packages this one depends on. In the hierarchical module scheme, the only thing that changes is that the search paths are now all "roots" of the hierarchical namespace (see my previous message). Cheers, Simon

GHC has a concept of a "package", which is basically a compiled unit consisting of libraries and interfaces (not necessarily Haskell).
OK, so this would correspond (roughly) to Java packages, while Haskell modules correspond to Java classes? Note that in Java, you can import a class (`import Foo.Bar') or a package (`import Foo.*'), and that's a syntactic difference built into the language. Do we need the same thing for Haskell? Then the compiler/linker would know: import a package: link with libPack.a; import a module: link with Module.o
For each package, the compiler has a specification telling it ^^^^^^^^^^^^^^^^ So you'd have to change the compiler (driver script) if you want to add a package? Yes I know how this works with ghc now, but I thought the new namespace proposal could somehow give a more uniform solution. -- -- Johannes Waldmann ---- http://www.informatik.uni-leipzig.de/~joe/ -- -- joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
participants (2)
-
Johannes Waldmann
-
Simon Marlow