id	summary	reporter	owner	description	type	status	priority	resolution	keywords	cc	topic	difficulty	mentor
1564	C Bindings to Haskell Values	aluink	aluink	"Write an tool to convert Haskell values, structures and functions, to C bindings.

== Overview ==

  * Convert Functions
  * Convert Data Structures
  * Typing
  * Documentation

== Convert Functions ==

We need to find a way to convert Haskell functions, or pointers to, into C function pointers.  This would allow many things to follow.  Haskell class(HC) instances could have C Class(CC) definitions.  So then calling the HC functions would be as simple as referring to the functions pointers stored in the CC.  How to deal with general module functions is something to think about still.  Something to also think about is how to convert the function pointers back to Haskell functions.  This will be needed when passing function pointers to Haskell function calls.  Do we want to allow the ""lifting"" of regular C functions into the pointers to Haskell functions so they can be passed to Haskell functions?  This would almost seem required with such a system.

== Convert Data Structures ==

Structures created with ""data"" will most likely be GObjects.  Those done with ""newtype"" will most likely have to be duplicated, or maybe we can get away with #defines.  If anything, we should probably be able to get away with a #define for ""type"" definitions.  Some standard structures from the Prelude will have to be converted and included in the conversion tool.  

== Typing ==

Haskell has a, to put it lightly, strong typing system.  We need to think about how to bring that into the C context.  How much of it do we want to preserve?

== Documentation ==

Any good tool is useless without documentation.  Part of the deliverables of this project will be documentation on usage, how it works, and some man pages."	spam	new	OK		C bindings		Bindings	1 person Summer	not-accepted
