> And FWIW I never use h2xs for C code as it is much safer to write
> bindings by hand as XS code and even the relatively trivial task
> of parsing C declarations is often "wrong".

Same here. I *always* write XS code by hand. If I use h2xs at all, then
only to generate all the template files.

I also often find the automated API translations (even when they are
correct) to be rather un-Perlish. I believe the time spent in making a
robust Perl API almost always pays off later in reduced debugging times
at the application level.

I understand that wrapping a huge API can be a lot of work, but often
you can wrap it into a much smaller high-level API for Perl and put more
abstraction into the XS code. I know that some people (e.g. Tye McQueen)
disagree with this and rather recommend a thin XS layer and then a
second abstraction layer in Perl, in which case a working h2xs for C++
would be handy indeed.

Cheers,
-Jan



Reply via email to