Skip to content
Exercise in dealing with Haskell shared libraries
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
LICENSE
Makefile
README.md

README.md

haskell-so-example

Example C program, showing to to call Haskell shared libraries. Also demonstrates how to build a dynamically- and statically-linked Haskell shared library.

Usage

$ make test
...
PASS

Dynamic

Entrée: A shared library with a pure Haskell centre, linked with dynamic Haskell libraries.

$ make dynamic-build
...
$ make dynamic-test
...
Testing dynamic flavour
  Simple test:    PASS
  Threaded test:  PASS

Static

Plat principal: A shared library with a pure Haskell centre, linked with static Haskell libraries.

$ make static-build
...
$ make static-test
...
Testing static flavour
  Simple test:    PASS
  Threaded test:  PASS

Note: On Linux, the static flavour requires rebuilding GHC packages as position-independent code.

About

Made by Miëtek Bak. Published under the BSD license.

Acknowledgements

Thanks to Albert Lai for an illuminating series of articles, including “Calling Haskell Shared Libraries from C”.

You can’t perform that action at this time.