enormous binaries

Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Tue, 02 Oct 2001 15:04:21 +1000


Willem Robert van Hage <wrvh@xs4all.nl> wrote,

> I'm trying out GHC along with gtk+hs and iHaskell
> and I was surprised that a simple example with a list of selectable
> distribution names generated a binary of 2Mb.
> So I tried a simple hello world example exactly like the one
> I saw somewhere on the GHC pages that compiled to a binary of 6kb
> and I was surprised to see that even after stripping the binary
> it still takes up 140kb.
> Is there a good explanation for this? Am I doing something wrong
> or is it something else?

The whole Gtk+HS libraries are linked in even if you only
need a fraction of the available functionality.  It is
possible to get GHC to handle this somewhat better (as done
with all the libraries distributed in the GHC bundle):

  http://haskell.org/pipermail/gtkhs/2001-August/000068.html

Cheers,
Manuel