This illustrates building a shared library (.so
) in Haskell and calling it from C and Python.
I wrote nothing by myself, but read and pasted the code from those articles:
- Buildings plugins as Haskell shared libs
- Building a shared library in Haskell
- Using both Python & Haskell with ctypes
I've made sure everything compiles and works as expected on Ubuntu 12.04 x86_64 with GHC 7.4.1
from standard Ubuntu repositories. Edit Makefile
if you have another version (there's no autoconf,
so no libHSrts-*.so
version detection).
Use make run
to build and run examples.