[capi-sig] Announcing project PyBindGen

Gustavo Carneiro gjcarneiro at gmail.com
Tue Sep 25 12:39:33 CEST 2007


On 25/09/2007, Stefan Behnel <python_capi at behnel.de> wrote:
>
>
> Gustavo Carneiro wrote:
> >   I'd like to announce a new project for producing python extensions,
> called
> > PyBindGen.  It follows a radical new path for Python bindings
> generation: it
> > is itself written in (gasp!) Python!
>
> As are the wrapper generators, as it seems:
>
>
> http://codebrowse.launchpad.net/~gjc/pybindgen/devel/annotate/gjc%40inescporto.pt-20070924134815-90pequnwfrfy3i3c?file_id=foomodulegen.py-20070602135951-l3yn3vrhs0ctn6ux-1
>
> Do you really have to write all of this by hand to 'generate' a wrapper?
> How
> do you make it functional? (or does it require an exact API mapping?)


I don't understand what "exact API mapping" means.

But yes, so far you have to write all this by hand.  Although would love to
have automatic header file scanning, one day... unfortunately I have not had
enough time for that, and would rather focus on the code generation for
now.  Lots of neat things could be done later on top of the pybindgen python
module interface...

I can't help the feeling that Pyrex/Cython code is quite a bit more readable
> -
> and definitely less verbose. Any chance you could motivate your design a
> little?


I don't  like having to learn a new language for this.  Just like
Boost.Python users are comfortable with C++ and avoid having to learn a new
language, PyBindGen users are comfortable with Python and don't have to
learn a new language.

Besides, pyrex/cython C++ support is poor or nonexistent.  Although I
acknowledge that if you wrap pure C libraries then this point is moot.

Finally, have you ever looked at the code generated by pyrex?  It is rather
scary...

-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the capi-sig mailing list