PyPy, is it a 1:1 replacement for CPython?

Dan Stromberg drsalists at gmail.com
Sat Jul 21 00:21:33 EDT 2012


On Fri, Jul 20, 2012 at 8:59 PM, Steven D'Aprano <
steve+comp.lang.python at pearwood.info> wrote:

> On Sat, 21 Jul 2012 13:35:21 +1000, Simon Cropper wrote:
>
> > Hi,
> >
> > Can you use PyPy as a direct replacement for the normal python or is it
> > a specialized compiler that can only work with libraries that are
> > manipulated to operate within its constraints (if it has any).
>
> PyPy should work perfectly with pure-Python software. I don't know if it
> is compatible with extension libraries written in C or Fortran.
>
PyPy generally does great with pure python that doesn't depend on any C
extension modules.  Sometimes Pypy will have Pure Python equivalents,
sometimes it won't.  Sometimes when it doesn't, it does the job with ctypes
interfaces, but you generally don't need to know that.

Pypy can run some C extension modules, but the PyPy-C boundary is a bit of
a slowish hack called cpyext.

They're working on a new CFFI module/library that hopes to work nicely with
tailor-made modules, which, curiously enough, requires a C compiler at
runtime.  I gather they've got it running on CPython now,  with plans for
making it run on PyPY before long.


>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120720/dfec3478/attachment.html>


More information about the Python-list mailing list