
Hi! I'd like to make Haskell bindings for some C library and I'm wondering if someone was/is thinking about writing Haskell support for SWIG or the present Haskell tools provide better route for such a task(s)? Sincerely, Gour -- Gour | gour@mail.inet.hr Registered Linux User | #278493 GPG Public Key | 8C44EDCD

I'd like to make Haskell bindings for some C library and I'm wondering if someone was/is thinking about writing Haskell support for SWIG or the present Haskell tools provide better route for such a task(s)?
I think the general feeling is that your best bets are to use the raw ffi or to use one of the existing preprocessors. hsc2hs is probably the most popular approach these days and was used for most of the libraries that come with ghc, hugs, etc. You can get more information about tools from this page: http://www.reid-consulting-uk.ltd.uk/docs/ffi.html -- Alastair Reid

Alastair Reid (alastair@reid-hoffmann.net) wrote:
I think the general feeling is that your best bets are to use the raw ffi or to use one of the existing preprocessors. hsc2hs is probably the most popular approach these days and was used for most of the libraries that come with ghc, hugs, etc.
Thank you for the hint.
You can get more information about tools from this page:
Is there some hsc2hs tutorial available (besides the above + ghc docs)? Sincerely, Gour -- Gour | gour@mail.inet.hr Registered Linux User | #278493 GPG Public Key | 8C44EDCD

Hi, I'm not a Haskell expert, but you may find GreenCard useful (http://www.haskell.org/greencard/). And from my previous experience, you can write Haskell bindings to C using Haskell only, without any coding in C. You'd better read the FFI specifications (http://www.cse.unsw.edu.au/~chak/haskell/ffi/). Regards, Jinwoo -----Original Message----- From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users-bounces@haskell.org] On Behalf Of Gour Sent: Wednesday, June 30, 2004 1:03 AM To: glasgow-haskell-users Subject: Haskell module for SWIG Hi! I'd like to make Haskell bindings for some C library and I'm wondering if someone was/is thinking about writing Haskell support for SWIG or the present Haskell tools provide better route for such a task(s)? Sincerely, Gour -- Gour | gour@mail.inet.hr Registered Linux User | #278493 GPG Public Key | 8C44EDCD _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

On Tue, Jun 29, 2004 at 06:03:17PM +0200, Gour wrote:
I'd like to make Haskell bindings for some C library and I'm wondering if someone was/is thinking about writing Haskell support for SWIG or the present Haskell tools provide better route for such a task(s)?
Although perhaps not the simplest way to go about your task, haskell support for SWIG would be great! it would immediatly give us access to A LOT of C/C++ libraries which already have swig bindings. targeting hsc would probably be best, as the portable hsc files could be distributed for those that don't have haskell-swig nativly installed. If anyone is looking for a random project, I recommend it. John -- John Meacham - ⑆repetae.net⑆john⑈

John Meacham (john@repetae.net) wrote:
Although perhaps not the simplest way to go about your task, haskell support for SWIG would be great! it would immediatly give us access to A LOT of C/C++ libraries which already have swig bindings.
I also thinks so. Playing in the past with Ruby+SWIG looked very easy, but in the meantime I decided to try switch to Haskell :-)
targeting hsc would probably be best, as the portable hsc files could be distributed for those that don't have haskell-swig nativly installed. If anyone is looking for a random project, I recommend it.
I'd be happy if I could help more with the project, but at the moment just investigating if it would be feasible sicne I cannot estimate the level of difficulty in implemennting it. Sincerely, Gour -- Gour | gour@mail.inet.hr Registered Linux User | #278493 GPG Public Key | 8C44EDCD
participants (4)
-
???
-
Alastair Reid
-
Gour
-
John Meacham