Best way to call Haskell functions from within Java

后端 未结 4 874
孤街浪徒
孤街浪徒 2020-12-08 20:14

I\'m looking an efficient way of executing Haskell functions from within a Java program. I\'ve considered the use of exec() to interact with GHC, but it seems like there sho

4条回答
  •  渐次进展
    2020-12-08 21:02

    I assume you know how to call C from Java? If so, then you can follow the FFI guide to call Haskell from C, and C from Java, creating a bridge. This is a native call, and may require some fiddling with linkers.

    Details on calling Haskell from C are here: http://www.haskell.org/haskellwiki/Calling_Haskell_from_C

    Alternatively, you might consider an RPC server.

提交回复
热议问题