[pypy-dev] missing things for making PyPy "production" ready (for some value of production)
david at ar.media.kyoto-u.ac.jp
Mon Nov 19 04:02:49 CET 2007
Neal Becker wrote:
> David Cournapeau wrote:
>> Carl Friedrich Bolz wrote:
>>> Neal Becker wrote:
>>>>>> Indeed. But there are tools to generate most of the painful code:
>>>>>> Swig, boost::python, and others.
>>>>>> With Swig, you can even subclass C++ classes and override virtual
>>>>>> methods in python.
>>>>>> I wish pypy could do the same.
>>>>> Both methods involve parsing C++, which is not fun. For example,
>>>>> concerning wxwidget, I for once think it would be much easier to wrap
>>>>> gtk than wxwidget (if we think: would be good to have a GUI lib for
>>>>> pypy); incidently, that's how pygtk is generated (some python + scheme
>>>>> code generate the pygtk wrapper around gtk).
>>>> boost::python does not involve parsing c++.
>>> yip, it does. The compiler parses C++, after all :-).
>> You are not nitpicking at all: boost::python uses Py++, which uses
>> gccxml to parse the C++. There is no way around it: since it is
>> extremely difficult to interoperate with any C++ ABI, you need to
>> interoperate at the source level, parsing the monstruosity that C++ is
>> compared to C.
> No. You can use py++ if you like to generate boost::python. This (py++) is
> fairly new, and I believe relatively few boost::python users follow this
> route. Most of us write boost::python wrappers by hand (it's usually
> pretty easy).
I was talking in the context of automating wrapping. Of course, you can
wrap by hand, and it is as easy as in C for a few functions (I myself
much prefer ctypes, though, but I am obviously biased against C++ :) ).
But for 500 classes / 3000 functions, I doubt this is practical (the
only big C++ wrapper I am somewhat familiar with in python is pyqt,
which uses its own thing for the wrapping...).
Once you need something at least partially automatic, you need parsing
the code you are wrapping. For pypy, this is what is needed, no ?
More information about the Pypy-dev