
What is Hacanon? Hacanon is a Template Haskell library which automates the process of binding Haskell to libraries written in C++. It's designed to capture common patterns and allow the programmer to specify the desired behaviour accordingly. Hacanon is capable of generating a usable binding, without any interaction, to almost any piece of C++. This binding is of relatively high level, because Hacanon translates enumerations to Haskell data structures, has transparent callback support and overloads every function. Unfortunately, such a binding would, in most cases, be flawed. Is 'int*' an array, variable which holds a second result or something third? Here Hacanon provides a data interface scheme (aka DIS) system which allows the programmer to concisely describe how an argument should be handled. DISs can be derived from other DISs because they're nothing more than data structures. This gives rise to increased code reuse and minimizes the burden on the programmer. These DISs can be used in the appliance system where the programmer can guard on function name (via regex), argument type and argument number. Some of the features sound familiar. Is Hacanon related to GreenCard or HDirect? I've borrowed the DIS concept from GreenCard and directional arguments from HDirect. I would like to think I've taken the best of both worlds and added some innovation in form of automation. Dependencies: * Recent version of GHC. Tested with ghc-6.4.20050209 and ghc-6.4.20050219. http://www.haskell.org/ghc * HaXml 1.12. http://www.cs.york.ac.uk/fp/HaXml/ * GCCXML from CVS hacked to include template information. Hack is distributed with Hacanon. Author and availability: Hacanon is written by David Himmelstrup and published under a MIT-style license. Darcs repository: http://www.scannedinavian.org/repos/hacanon/ -- Friendly, Lemmih

On Mon, 21 Feb 2005, Lemmih wrote:
Some of the features sound familiar. Is Hacanon related to GreenCard or HDirect?
So I ask again, what I always ask: Is there someone working on a Haskell backend for SWIG? Not that SWIG is outstandingly well organised, but it provides an extensive framework for several odd C++ features. Once I have prepared a SWIG wrapper description say for Modula-3 I could faster add a wrapper for Haskell.

On Mon, 21 Feb 2005 13:47:02 +0100 (MET), Henning Thielemann
So I ask again, what I always ask: Is there someone working on a Haskell backend for SWIG? Not that SWIG is outstandingly well organised, but it provides an extensive framework for several odd C++ features. Once I have prepared a SWIG wrapper description say for Modula-3 I could faster add a wrapper for Haskell.
SWIG was one of the first I looked at but something about it turned me off so badly. But comparing the two ways of doing the same thing would be neat so send me mail once your finished. -- Friendly, Lemmih
participants (2)
-
Henning Thielemann
-
Lemmih