https://github.com/drdaeman/haskell-library-ffi-example
An example of building a shared library (.so) in Haskell and calling it from C and Python.
https://github.com/drdaeman/haskell-library-ffi-example
Last synced: about 1 year ago
JSON representation
An example of building a shared library (.so) in Haskell and calling it from C and Python.
- Host: GitHub
- URL: https://github.com/drdaeman/haskell-library-ffi-example
- Owner: drdaeman
- Created: 2012-08-30T20:37:35.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-08-30T20:45:37.000Z (almost 14 years ago)
- Last Synced: 2025-02-09T02:51:07.652Z (over 1 year ago)
- Language: C
- Homepage:
- Size: 97.7 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Haskell/C shared library example
================================
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][1]
- [Building a shared library in Haskell][2]
- [Using both Python & Haskell with ctypes][3]
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.
[1]: http://www.well-typed.com/blog/30
[2]: http://weblog.haskell.cz/pivnik/building-a-shared-library-in-haskell/
[3]: http://wiki.python.org/moin/PythonVsHaskell#Using_both_Python_.26_Haskell_with_ctypes_.28-.3B