How to compile Haskell to a static library?

后端 未结 2 876
没有蜡笔的小新
没有蜡笔的小新 2020-12-08 05:25

Hey, I\'m learning Haskell and I\'m interested in using it to make static libraries for using in Python and probably C. After some googling I found out how to get GHC to out

2条回答
  •  抹茶落季
    2020-12-08 05:34

    This makes ghc compile statically (note that the pthread is before optl-static): ghc --make -static -optl-pthread -optl-static test.hs

    Edit: But the static compilation seems to be a bit risky. Most of the times there are some errors. And on my x64 fedora it doesn't work at all. The resulting binary is also quite large, 1.5M for main = putStrLn "hello world"

提交回复
热议问题