On Sat, 27 Oct 2007, Richard Jones wrote: > On Sat, Oct 27, 2007 at 10:43:46AM +0200, Daniel Bünzli wrote: >> Le 26 oct. 07 à 22:36, Christopher L Conway a écrit : >>> I'm trying to write an interface to an existing C library using >>> Camlidl and I'm having trouble in just a few cases... >> >> I'd say don't use camlidl. It seems to be unsupported software. There >> is for example a bug the handling of records of floats only that I >> reported a long time ago but was lost in the bugtracker update. I >> guess it wasn't fixed. >> >> Try to understand the caml-c interface (chap. 18 of the manual) and >> then use C pre-processor hacks to streamline the development of your >> bindings, have a look at lablgl to see what I mean by that. > > Absolutely agreed. > > While I think there is room for someone to _really_ tackle the issue > of building interfaces to C automatically (using something like CIL > and a bucket-load of meta-information about how the C library deals > with memory), until that day comes it's just much better to write the > bindings by hand. > > I've used the native interface APIs for several languages including > Java, Perl and Python, but OCaml's is by far the easiest. Well, maybe > apart from C++ :-) > > Rich. I'm afraid I don't understand this position at all. With a few dozen, mostly obvious, annotations to the header files, I have covered 99% of the library's functionality, automatically generating several thousand lines of low-level boilerplate code. Leaving aside the possibility of known bugs in Camlidl that might never get fixed... why would I want to code this all by hand? Regards, Chris