Hs2lib

A Library and Preprocessor that makes it easier to create shared libs from Haskell programs. http://blog.zhox.com/category/hs2lib/

Latest on Hackage:0.6.3

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD3 licensed and maintained by Tamar Christina <tamar (at) zhox.com>

The supplied PreProcessor can be run over any existing source and would generate FFI code for every function marked to be exported by the special notation documented inside the package. It then proceeds to compile this generated code into a lib.

The Library contains some helper code that's commonly needed to convert between types, and contains the code for the typeclasses the PreProcessor uses in the generated code to keep things clean.

It will always generated the required C types for use when calling the dll, but it will also generate the C# unsafe code if requested.

Read http://www.scribd.com/doc/63918055/Hs2lib-Tutorial#scribd

A replacement for this library is in development and will eventually replace this

Current Restrictions:

  • Does NOT support x64 bit versions of GHC. This will be added in future versions if enough demand exist.

  • You cannot export functions which have the same name (even if they're in different modules because 1 big hsc file is generated at the moment, no conflict resolutions)

  • You cannot export datatypes with the same name, same restriction as above.

  • Does not support automatic instance generation for infix constructors yet

  • List of Lists are not supported (concat them first).

NOTE: Package is now working again, but I have fixed the version of haskell-src-exts to prevent it from breaking again.

comments powered byDisqus