News for hackers. Stuff that matters.
Re:Learn You a Haskell is now in print by rwmj on Tuesday March 29, 2011 @02:53PM (#2383881)
Slightly OT: Can someone point to a good, comprehensive tutorial on how to call C code from Haskell?

Background: libguestfs Haskell bindings need a lot of love, and the FFI deeply confuses me.

Re:Learn You a Haskell is now in print by joelburget on Tuesday March 29, 2011 @02:57PM (#2383894)
I've been writing some ffi myself code lately. The real world haskell chapter on ffi has been helpful. They use a bit of hsc2hs on top of plain ffi. I've also been using c2hs which does a lot of the work for you (a bit higher level) and have found Edward Z Yang's guide helpful for that.
Re:Learn You a Haskell is now in print by pjscott on Tuesday March 29, 2011 @05:24PM (#2384558)
Real World Haskell is also online, by the way, so you can check out the chapter on FFI right here:

http://book.realworldhaskell.org/read/interfacing-with-c-the...

It walks you through making some basic PCRE bindings, which is a big enough example that they manage to touch on the important issues. It's a pretty good introduction, I would say, especially in the part that covers interfacing C strings with ByteStrings.

Re:Learn You a Haskell is now in print by rwmj on Tuesday March 29, 2011 @06:32PM (#2384802)
I read this when I was doing the original porting and TBH it's very lightweight.

Also (to reply to GP) c2hs is no use because we already have a very detailed and specific description of the interface, and a generator that does all the other bindings[1]. We want to know precisely how to translate our description into Haskell, we don't want to go through another layer.

[1] http://git.annexia.org/?p=libguestfs.git;a=tree;f=generator;...

Re:Learn You a Haskell is now in print by ionfish on Tuesday March 29, 2011 @07:03PM (#2384931)
Aside from the reading material others have suggested, I strongly recommend the #haskell channel on Freenode. The people there are extremely helpful and friendly.
Re:Learn You a Haskell is now in print by neutronicus on Tuesday March 29, 2011 @10:10PM (#2385470)
Seconded. #haskell and #lisp on freenode are both great.
Re:Learn You a Haskell is now in print by rtaycher on Wednesday March 30, 2011 @12:33AM (#2385816)
I found #squeak and #csharp quite good