Making small haskell executables?

前端 未结 7 1454
野趣味
野趣味 2020-12-12 22:12

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 abou

相关标签:
7条回答
  • 2020-12-12 23:07

    You should count your blessings (370Kb? Luuuxury) :

    bash$ sbcl
    This is SBCL 1.0.24, an implementation of ANSI Common Lisp.
    
    * (sb-ext:save-lisp-and-die "my.core")
    [undoing binding stack and other enclosing state... done]
    [saving current Lisp image into ./my.core:
    ...
    done]
    bash$ du -sh my.core 
     25M    my.core
    bash$ 
    

    Seriously though while you can probably shake out haskell binaries a bit, it's really not a fair comparison with C. There's a more going on there.

    Last time I played with ghc (and this might be out of date) it was statically linking everything, which will be a factor.

    0 讨论(0)
提交回复
热议问题