
I noticed that GHC generates huge executables. module Main(main) where main = do putStr("Hello World!") is almost 600kB after compiled! Is there any way to make it smaller? Best regards, -- Rafael Gustavo da Cunha Pereira Pinto Electronic Engineer, MSc.

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
participants (3)
-
Chad Wilson
-
John Dorsey
-
Rafael Gustavo da Cunha Pereira Pinto