C -> Haskell, or Yet Another Interfacing Tool (Revised Version)

Manuel M. T. Chakravarty

In Pieter Koopman and Chris Clack, editors, Implementation of Functional Languages, 11th. International Workshop (IFL'99), Springer-Verlag, LNCS 1868, 2000.

Abstract
This paper discusses a new method for typed functional languages to access libraries written in a lower-level language. More specifically, it introduces an interfacing tool that eases Haskell access to C libraries. The tool obtains information about the C data type definitions and function signatures by analysing the C header files of the library. It uses this information to compute the missing details in the template of a Haskell module that implements a Haskell binding to the C library. Hooks embedded in the binding file signal where, which, and how C objects are accessed from Haskell. The Haskell code in the binding file determines Haskell type signatures and marshaling details. The approach is lightweight and does not require an extra interface description language.

Online version (Springer Verlag)
PostScript preprint (16 pages).

This page is part of Manuel Chakravarty's WWW-stuff.