
17 Jul
2008
17 Jul
'08
2:54 p.m.
I noticed that GHC generates huge executables.
As I recall, GHC only uses shared libraries on OSX. Your executable probably has a lot compiled in statically. Even though I'm pretty sure GHC does what it can for dead code elimination, statically linked executables tend to be largish. A good bit of that executable size may be GHC's machinery, like the garbage collector and thread manager. If you haven't already, and if you're on a unix variant, then you can probably save some space by stripping the executable: $ ghc --make hello $ strip hello Is space usage critical for you? Try different optimization levels. Use compression. Eliminate dependencies on large external libraries, if possible. I just got used to it. John