Making small haskell executables?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Are there any good ways to make small haskell executables? With ghc6 a simple hello world program seems to come to about 370kB (523kB before strip). Hello world in C is about 4kB (9kB before strip). 回答1: With the development branch of GHC (anyone know exactly which version this was added in?): $ ghc - o hello hello . hs $ strip - p -- strip - unneeded -- remove - section =. comment - o hello - small hello $ du hello hello - small 700 hello 476 hello - small Add the -dynamic flag for a dynamically linked RTS: $ ghc - dynamic - o