[Haskell-beginners] Crash Course for C++ "Refugees"?

Mark Santolucito mark.santolucito at yale.edu
Wed Aug 13 17:40:34 UTC 2014


Hi Frank,

You are looking for the foreign function interface (FFI) for Haskell.
Googling this will produce no end of _somewhat_ useful results. Basically
you can call Haskell from C and vice versa. I'm not aware of a hs ffi
explicitly for C++, but it is essentially the same/likely short work to do
the C<->C++ interface for any particular application.

http://www.haskell.org/haskellwiki/FFI_Introduction

http://www.haskell.org/haskellwiki/GHC/Using_the_FFI

There is some code that I wrote for an abandoned project that might help
you out at lotusstem.us/ffi.zip (sorry for the random site, the code
somehow ended up on that server and I'm without a laptop to easily move it
now). If i remember correctly I had issues with hsFFI.h so just avoided
using it entirely. Likely not the correct approach but hopefully enough to
get you started.

Mark
On Aug 13, 2014 1:20 PM, "Frank" <frankdmartinez at gmail.com> wrote:

> Hi,
>     I have recently been introduced to Haskell and find it quite
> fascinating. I am interested in incorporating it into a C++ project on
> which I am working, porting pieces of that program to Haskell when
> practical. Is Anyone able to point Me in the direction of a "crash course"
> or "quick start" guide for Anyone used to programming in C++ seeking to
> call Haskell code from the C++ portion and/or vice versa? I am especially
> interested in knowing how to pass information from, say, the C++ standard
> template library containers (e.g., vector, valarray, etc.) and into Haskell
> functions/methods/procedures/etc. While I might have missed such
> information when I performed a web search on the topic, I did not find any
> information to help. Any assistance in finding such material would be
> greatly appreciated.
>
> Sincerely,
> Frank D. Martinez
>
> --
> P.S.: I prefer to be reached on BitMessage at
> BM-2D8txNiU7b84d2tgqvJQdgBog6A69oDAx6
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20140813/cb105c76/attachment.html>


More information about the Beginners mailing list