[Haskell-cafe] [ANN] Haskell FFI Tutorial

Charlie Durham cpdurham at gmail.com
Sat Nov 8 17:06:53 UTC 2014


I just built an FFI Interface for a camera in C++ called from Haskell, it
would be nice to see an interface done for C++ with objects. I got it
working pretty quickly searching around from other sites, but it would be
cool if it was all in one place.

Sort of off topic, I had an issue where the main in C++ ran perfectly fine
calling into what I believe to be a singleton, but calling from Haskell led
to that call freezing every time. If I put the call to the singleton into a
static block, it runs fine calling from Haskell. Is this probably the
"Static order initialization fiasco"?

Charlie

On Sat, Nov 8, 2014 at 10:54 AM, Alex Petrov <oleksandr.petrov at gmail.com>
wrote:

> Hi Everyone,
>
> I've recently started working on Haskell FFI Tutorial [1]. The repository
> already
> contains code that explains how to:
>
>   * (expressively) represent C `struct` in Haskell code
>   * call C code from Haskell
>   * call Haskell code from C
>   * operate on nested `struct`s
>   * operate on `struct` arrays
>   * decode `unions`
>   * read and write C fixed-length strings and Pointer-type Strings
>   * how to import functions from, for example, stdlib
>
> I'm still working on more story-like writeups, but the first one (about
> how to call Haskell
> from C) is already available [2].
>
> If you have any feedback / comments / questions, know how to improve it or
> would like to see more things covered, just ping me.
>
> Thanks
>
> [1] https://github.com/ifesdjeen/haskell-ffi-tutorial
> [2]
> https://github.com/ifesdjeen/haskell-ffi-tutorial#calling-haskell-from-c
>
>
> --
>
>
> Alex
> https://twitter.com/ifesdjeen
>
> http://clojurewerkz.org/
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20141108/9ba06e8d/attachment.html>


More information about the Haskell-Cafe mailing list