[Haskell-cafe] ANNOUNCE: call-haskell-from-anything 1.0
mail at nh2.me
Sun Jan 31 03:30:27 UTC 2016
I'm happy to announce a new release of call-haskell-from-anything ,
my library for FFI-via-serialisation that allows to easily call Haskell
functions from any other language that can open shared object files
(`.so` via `dlopen()`) and has a MessagePack library available.
This is almost all programming languages; for examples for Python and
Ruby see .
The FFI-via-serialisation approach makes it possible to export most
functions to other languages "for free": no FFI type unpacking
boilerplate, everything that has a MessagePack instance (much easier to
write than `Storable` instances) will do.
For example if you have a function
chooseMax :: [Int] -> Int
all you have do to make it callable is
foreign export ccall chooseMax_export :: CString -> IO CString
chooseMax_export = export chooseMax
Version 1.0 uses closed type families to remove the restriction that so
far, pure functions has to be wrapped into the Identity monad to be
a -> b -> ... -> Identity r
With 1.0, this is no longer necessary. You can now export any function
a -> b -> ... -> r
to be called from your favourite Haskell contender languages (of course
those have no chance ...).
More information about the Haskell-Cafe