Haskell Generates FFI Export Shell Code

I am writing code in haskell that needs to be called from C. Is there a tool or library in Haskell that makes it easy to write FFI shell code for haskell functions that need to be exported.

For example, the tool specified by the haskell function that will be exported will take care (generate shell code) to map the haskell types to the correct Foreign.C types, etc. as needed. He will also take care of creating the correct pointers when displaying [Int] types, etc. Like what is trying to ask the question here Automatic type conversion for FFI calls in Haskell . But is it only available as a library?

+7
source share
1 answer

For this, I wrote the Hs2lib tool. If you are on Windows, you're in luck, it will do everything, including compiling the code in dll and creating wrappers c / C ++ or C #. If you are working on Linux, I am afraid that I have not yet completed the compilation stage, but it still produces the required information and stubs. You can say to save them using the -T flag.

+1
source

All Articles