large binaries

Alastair Reid alastair@reid-consulting-uk.ltd.uk
18 Jul 2002 21:21:50 +0100


> Is there some reason haskell binaries have to be statically linked?
> I can't seem to find a way to make them otherwise, at least with
> ghc.

The ELF dynamic linking format seems to be designed on the assumption
of poor code reuse (e.g., C code) where calls from one module to
another are rare and can therefore be expensive.

Haskell code has very high levels of reuse and calls from one module
to another (especially calls into Prelude, List, Monad, etc) are very
common so dynamic linking imposes a very high overhead.

This isn't a reason to not support dynamic linking but it's a reason
to make it a low priority.  Incidentally, it avoids confusion between
the performance overhead of lazy evaluation and the performance
overhead of dynamic linking of modular code.


-- 
Alastair Reid                 alastair@reid-consulting-uk.ltd.uk  
Reid Consulting (UK) Limited  http://www.reid-consulting-uk.ltd.uk/alastair/