
I'm still going through the GHC tutorial, so be patient with me: But why is it that my GHC-produced executables are always so large? Even my one line Hello World program ends up being over 500KB. I thought maybe it was because all of the functionality was statically compiled in, but I used ldd and saw that my hello world binary links dynamically to 10 different C libraries. (I compile on Gentoo Linux x86, if that makes a difference.) Anyway, is that just the way it is, or does this become a non-issue once I learn proper optimization/linking techniques? -- frigidcode.com theologia.indicium.us

Christopher Howard wrote:
I'm still going through the GHC tutorial, so be patient with me: But why is it that my GHC-produced executables are always so large? Even my one line Hello World program ends up being over 500KB. I thought maybe it was because all of the functionality was statically compiled in, but I used ldd and saw that my hello world binary links dynamically to 10 different C libraries.
Its that size because the Haskell libraries are statically linked into your program. See this SO question/answer: http://stackoverflow.com/questions/6115459/small-haskell-program-compiled-wi... Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/

On 05/25/2011 08:02 PM, Erik de Castro Lopo wrote:
Christopher Howard wrote:
I'm still going through the GHC tutorial, so be patient with me: But why is it that my GHC-produced executables are always so large? Even my one line Hello World program ends up being over 500KB. I thought maybe it was because all of the functionality was statically compiled in, but I used ldd and saw that my hello world binary links dynamically to 10 different C libraries.
Its that size because the Haskell libraries are statically linked into your program.
See this SO question/answer:
http://stackoverflow.com/questions/6115459/small-haskell-program-compiled-wi...
Erik
Thanks! Great link! I only wish I had known about that sooner... It looks like I'll need to reinstall at least a few dozen modules with --enabled-shared. I'm surprised that cabal-install doesn't enable that by default. -- frigidcode.com theologia.indicium.us
participants (2)
-
Christopher Howard
-
Erik de Castro Lopo