Boost logo

Boost Users :

From: Drumheller, Michael (michael.drumheller_at_[hidden])
Date: 2006-01-15 19:01:19

(Sorry for the lateness of this response to the notes of Dave Abrahams,
Kirke, Stefan Seefeld & Roman Yakovenko.)

I asked whether anyone out there gets anything done using Boost.Python
*without* using Pyste or pyplusplus, and I said

>> It does not seem like a practical thing to do--but maybe I'm missing
>> something...?

Dave replied:

>> Why do you say that?

Similarly, Stefan replied:

>> I have been using boost.python for a number of projects but I never
>> used pyste for any of them. What's wrong with that ? What do you
>> think *I* am missing ?

(By the way, Stefan: Does your above remark mean you have not tried
Pyste, or
you tried it and decided to use Boost.Python directly?)

To answer your questions: Maybe I *would* just be using Boost.Python
directly if I had spent a more time getting used to it at the beginning.
But I
found that getting even the simplest class hierarchies with virtual
to work was an error-prone pain in the rear, not to mention a lot of
typing. I
discovered Pyste at the same time, and tried it, and looked at its
output and
said, "Wow, I'm glad I didn't have to write all that myself. Who has
time for
that?" I mean, Pyste's output is by definition a mechanical
transformation of
my C++ header files--why would I want to perform such a transformation
by hand?
That's how I got hooked on Pyste.

It occurs to me that maybe the reason you do not seem bothered by
Boost.Python code manually is that you're doing it "minimally," i.e.,
exposing that part (and only that part) of your C++ interface that
really needs
to be exposed at the Python level. I think I need to revisit my code
with this
in mind, and I will do that. And/or maybe I can/should just use Pyste
as a
"bootstrap" mechanism--to generate the *first version* of my
files, but maintain them manually thereafter. Roman indicates, with
that this is what a lot of people do, but I'm not sure it has really

Of course, there is at least one excellent reason for writing
wrappers by hand: The longer your tool chain, the more complicated your
A longer tool chain (i.e., a tool chain with Pyste *and* GCCXML in it)
makes it
harder for me to sell the hybrid Python/C++ approach to my
even to myself.

It is not clear to me what the right balance is between automatic
code generation & tool-chain complexity. I'm sure it is
project-dependent. I
suppose my main suggestion is that the Boost documentation might provide
guidance in making this trade-off. (There is a link to Pyste and that's
There is no discussion about trade-off or how to address it.)



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at