[Haskell] base libraries

Simon Marlow simonmarhaskell at gmail.com
Mon Nov 27 05:38:27 EST 2006


Malcolm Wallace wrote:
> Simon Marlow <simonmarhaskell at gmail.com> wrote:

>>However, it's highly unlikely that you'll ever be able to separate
>>ForeignPtr from the base library, because of the dependencies:
>>ForeignPtr is part of the FFI, the FFI is used by other libraries, etc.
>>etc.  The dependencies in base are very intertwined, as you well know.
> 
> Ah, so how do the other compilers manage it?  Answer: Hugs has a
> separate package 'hugs-base' with essential but implementation-dependent
> things like ForeignPtr in it.  (Likewise nhc98/yhc.)  The 'base' package
> just imports and uses it.  If we could separate out a 'ghc-base' package
> from 'base', that would be great.  (And I think that is one of Bulat's
> proposals.)

As I understand it, Hugs and nhc98 do this by having their own copies of a lot 
of the library code (up to and including the Prelude?).  We could do this for 
GHC, but it would mean extracting a lot of code that isn't really GHC-specific 
into ghc-base, and that doesn't seem like the right way to go.

So there are two approaches to reducing the size of the base package:

  1. removing modules from the top into separate packages
  2. try to extract a compiler-dependent portion from the bottom

(1) is way, way easier than (2), because of the heavily intertwined dependencies 
between the code underneath Prelude.  That's unfortunate.  Bulat did start to 
try to separate things this way, but he didn't finish (Bulat - did you give up 
because it was too hard, or just stop?).

In the wiki page, we describe how to get part of the benefit of (2) as far as 
the user is concerned, by having a separate "view" of the base package with the 
compiler-dependent modules removed.

Cheers,
	Simon


More information about the Libraries mailing list