Distributing a Haskell program as C source

后端 未结 7 1783
时光取名叫无心
时光取名叫无心 2021-02-06 22:57

Say I have a Haskell program or library that I\'d like to make accessible to non-Haskellers, potentially C programmers. Can I compile it to C using GHC and then distribute this

7条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 23:54

    Can I compile it to C using GHC and then distribute this as a C source?

    No it is not possible but you can easily create interface between haskell and c by using the Foreign Function Interface (FFI) of Haskell.

    You can have more example here.

提交回复
热议问题