
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