Skip to content

mietek/haskell-so-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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”.

About

Exercise in dealing with Haskell shared libraries

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages