On 30/09/2007, <b class="gmail_sendername">Joseph Lisee</b> <<a href="mailto:jlisee@gmail.com">jlisee@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Gustavo Carneiro <gjcarneiro <at> <a href="http://gmail.com">gmail.com</a>> writes:<br><br>><br>><br>> (manually replying from copy-pasting the archives because my c++-sig<br>subscription was disabled by accident).Nat Goodspeed wrote: >Gustavo
<br>Carneiro wrote:>> Hello all,>><br>> >> I'd like to announce a new project for producing python extensions, >><br>called PyBindGen. It follows a radical new path for Python bindings >>
<br>generation: it is itself written in (gasp!) Python! And it does not<br>> >> even use C++ templates at all! >Interesting! I would be curious to see you<br>contrast it with the Py++ >project:>><br>
> <a href="http://www.language-binding.net/pyplusplus/pyplusplus.html">http://www.language-binding.net/pyplusplus/pyplusplus.html</a>>>to get a sense of<br>when I might choose to use one vs. the other.I know Py++. You cannot compare
<br>Py++ with PyBindGen. I would say that PyBindGen replaces<br>> Boost.Python. Py++ is a layer on top of Boost.Python. Py++ generates<br>Boost.Python module definition sources through automatic scanning of C++ header
<br>files. PyBindGen lacks the header files scanning feature that Py++ provides,<br>and I really miss that feature in PyBindGen. I hope that someone (maybe me)<br>finds time to work on that for PyBindGen, some day... I'm not sure if Py++ is
<br>modular enough to be able to receive a different code generation backend besides<br>> Boost.Python (Roman, feel free to comment :).Although I like Py++ a lot, I<br>really hate Boost.Python. Maybe it's because of my lack of skill in
<br>understanding C++ templates, but I feel like Boost.Python hides too many details<br>underneath a layer of cryptic to follow set of C++ templates, while I need to<br>see the generated code in order to check that memory management details are
<br>being declared and implemented correctly. In addition, to compile<br>> Boost.Python based bindings your users need to have the boost python library<br>and header files installed. In contrast, PyBindGen generated extensions only
<br>require python development header files in order to compile, nothing more. I<br>also think<br>> Boost.Python extensions compile to rather large modules...Regards,-- Gustavo<br>J. A. M. CarneiroINESC Porto, Telecommunications and Multimedia Unit"The
<br>universe is always one step beyond logic." -- Frank Herbert<br>><br>><br>> _______________________________________________<br>> C++-sig mailing list<br>> C++-sig <at> <a href="http://python.org">
python.org</a><br>> <a href="http://mail.python.org/mailman/listinfo/c++-sig">http://mail.python.org/mailman/listinfo/c++-sig</a><br>><br><br>Let me chime in on the code generation side too. Just taking a look at your
<br>example, you have to write almost twice as much python wrapping code as there is<br>C++ in the header you are wrapping.</blockquote><div><br>But the generated code is nearly 10 times as large as the Python code the generates it, while still being relatively compact (I think it's very much smaller than an equivalent
boost.python module in terms of code size, although I have not bothered yet to create the same project with both boost.python and pybindgen to compare accurately).<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Is this case for all headers you wish to<br>wrap, or is it because you were overexercising your library?</blockquote><div><br>No overexercising; it's like this.<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I welcome a project that removes the longer compile times of Boost.Python. Yet<br>one of those reasons for the long compile times is because its hard to<br>understand template magic is doing quite a bit of work for you.</blockquote>
<div><br>I think Boost.Python has compile-time introspection for function/method parameters, and so you only have to tell Boost.Python a list of class names and method names; that's the main reason the BP interface description file is smaller.
<br></div></div><br>Admittedly, PyBindGen could use some introspection itself, but that can be an additional layer. I would like to have a layer that uses pygccxml, or something like that. Some day when I have more time... In the mean time I believe the PyBindGen Python API is already rather useful, if a bit more verbose than
boost.python.<br><br>-- <br>Gustavo J. A. M. Carneiro<br>INESC Porto, Telecommunications and Multimedia Unit<br>"The universe is always one step beyond logic." -- Frank Herbert