
Hello, 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? ~/haskell/ghc-test % cat hello.hs module Main where main = putStrLn "hello, world!" ~/haskell/ghc-test % ghc -o hello hello.hs ~/haskell/ghc-test % ls -l total 212 -rwxr-xr-x 1 willem users 201453 Sep 29 09:55 hello -rw-r--r-- 1 willem users 51 Sep 29 09:54 hello.hs -rw-r--r-- 1 willem users 1468 Sep 29 09:55 hello.o ~/haskell/ghc-test % strip hello ~/haskell/ghc-test % ls -l total 152 -rwxr-xr-x 1 willem users 141024 Sep 29 09:59 hello -rw-r--r-- 1 willem users 51 Sep 29 09:54 hello.hs -rw-r--r-- 1 willem users 1468 Sep 29 09:55 hello.o ~/haskell/ghc-test % strings hello > strs I attached the file strs, maybe someone can deduce something from its contents... Willem van Hage -- wrvh@xs4all.nl | http://www.xs4all.nl/~wrvh wrvhage@science.uva.nl | http://quest.sourceforge.net

Willem Robert van Hage
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
participants (2)
-
Manuel M. T. Chakravarty
-
Willem Robert van Hage