[pypy-dev] missing things for making PyPy "production" ready (for some value of production)

Martijn Faassen faassen at startifact.com
Thu Nov 15 13:23:07 CET 2007


David Cournapeau wrote:
> Martijn Faassen wrote:
>> Yes, this one would be a major challenge. If you can crack it and the 
>> PyPy interpreter offers another benefit (an obvious one is speed), you 
>> will be in awesome position. If not, the other benefits will have to 
>> weigh more strongly. This is definitely one to evolve slowly over time 
>> if it's possible at all.

> I don't understand the C++ part. How many useful python modules use C++ 
> ? For a start, my understanding is that python itself (interprter + 
> stdlib) do not use C++ at all. Wrapping C++ in any language other than 
> itself is a pain anyway :)

I took "wrapping a major C++ library using ctypes" as an example of the 
complexities involved. If PyPy *doesn't* offer a way to reuse existing 
CPython extensions, this means it'll have to be done again.

As someone who started with lxml, I can tell you that wrapping a major C 
library with Pyrex properly is also a lot of hard work - making garbage 
collection work as a Python programmer expects is a huge challenge. 
Doing that again for PyPy would feel like a waste of effort.

> I am personally interested in two things: being able to use any pure 
> python extension, and numerical code (I am a heavy user and sometimes 
> contributor to numpy/scipy). I don't think I am alone in this niche. For 
> example, someone on the numpy-discussion list asked about being able to 
> use numpy from iron python:
> 
> http://groups.google.com/group/c-extensions-for-ironpython/browse_thread/thread/88102263f8586fd0
> 
> what can be done about that ? Since I don't understand how pypy can 
> use/intend to use c-based extensions (I thought ctypes was the way, but 
> it looks like I misunderstood things), I am not sure what the 
> possibilities are *now*.

I think the minimum PyPy will do is make it possible to wrap C-based 
extensions using something like ctypes. As far as I understand that work 
hasn't been completed yet. The original post was also talking about the 
possible maximum, which is to support arbitrary third-party extensions 
that bind to non-python libraries, such as NumPy, pygame and lxml.

Regards,

Martijn




More information about the Pypy-dev mailing list