On 30/09/2007, <b class="gmail_sendername">Joseph Lisee</b> &lt;<a href="mailto:jlisee@gmail.com">jlisee@gmail.com</a>&gt; 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 &lt;gjcarneiro &lt;at&gt; <a href="http://gmail.com">gmail.com</a>&gt; writes:<br><br>&gt;<br>&gt;<br>&gt; (manually replying from copy-pasting the archives because my c++-sig<br>subscription was disabled by accident).Nat Goodspeed wrote:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &gt;Gustavo
<br>Carneiro wrote:&gt;&gt;&nbsp;&nbsp; Hello all,&gt;&gt;<br>&gt; &gt;&gt;&nbsp;&nbsp; I&#39;d like to announce a new project for producing python extensions, &gt;&gt;<br>called PyBindGen.&nbsp;&nbsp;It follows a radical new path for Python bindings &gt;&gt;
<br>generation: it is itself written in (gasp!) Python!&nbsp;&nbsp;And it does not<br>&gt; &gt;&gt; even use C++ templates at all! &gt;Interesting! I would be curious to see you<br>contrast it with the Py++ &gt;project:&gt;&gt;<br>
&gt; <a href="http://www.language-binding.net/pyplusplus/pyplusplus.html">http://www.language-binding.net/pyplusplus/pyplusplus.html</a>&gt;&gt;to get a sense of<br>when I might choose to use one vs. the other.I know Py++.&nbsp;&nbsp;You cannot compare
<br>Py++ with PyBindGen.&nbsp;&nbsp;I would say that PyBindGen replaces<br>&gt; Boost.Python.&nbsp;&nbsp;Py++ is a layer on top of Boost.Python.&nbsp;&nbsp;Py++ generates<br>Boost.Python module definition sources through automatic scanning of C++ header
<br>files.&nbsp;&nbsp;PyBindGen lacks the header files scanning feature that Py++ provides,<br>and I really miss that feature in PyBindGen.&nbsp;&nbsp;I hope that someone (maybe me)<br>finds time to work on that for PyBindGen, some day...&nbsp;&nbsp;I&#39;m not sure if Py++ is
<br>modular enough to be able to receive a different code generation backend besides<br>&gt; Boost.Python (Roman, feel free to comment :).Although I like Py++ a lot, I<br>really hate Boost.Python.&nbsp;&nbsp;Maybe it&#39;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.&nbsp;&nbsp;In addition, to compile<br>&gt; Boost.Python based bindings your users need to have the boost python library<br>and header files installed.&nbsp;&nbsp;In contrast, PyBindGen generated extensions only
<br>require python development header files in order to compile, nothing more.&nbsp;&nbsp;I<br>also think<br>&gt; Boost.Python extensions compile to rather large modules...Regards,-- Gustavo<br>J. A. M. CarneiroINESC Porto, Telecommunications and Multimedia Unit&quot;The
<br>universe is always one step beyond logic.&quot; -- Frank Herbert<br>&gt;<br>&gt;<br>&gt; _______________________________________________<br>&gt; C++-sig mailing list<br>&gt; C++-sig &lt;at&gt; <a href="http://python.org">
python.org</a><br>&gt; <a href="http://mail.python.org/mailman/listinfo/c++-sig">http://mail.python.org/mailman/listinfo/c++-sig</a><br>&gt;<br><br>Let me chime in on the code generation side too.&nbsp;&nbsp;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&#39;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;">
&nbsp;&nbsp;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&#39;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.&nbsp;&nbsp;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&#39;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.&nbsp; I would like to have a layer that uses pygccxml, or something like that.&nbsp; 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>&quot;The universe is always one step beyond logic.&quot; -- Frank Herbert