[pypy-commit] pypy default: Reimplementing every extension under the sun in cffi is not really that useful any more, recommend working with upstreams instead

rlamy pypy.commits at gmail.com
Tue Feb 7 14:21:02 EST 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: 
Changeset: r90004:8a778fab7e8a
Date: 2017-02-07 19:20 +0000
http://bitbucket.org/pypy/pypy/changeset/8a778fab7e8a/

Log:	Reimplementing every extension under the sun in cffi is not really
	that useful any more, recommend working with upstreams instead

diff --git a/pypy/doc/project-ideas.rst b/pypy/doc/project-ideas.rst
--- a/pypy/doc/project-ideas.rst
+++ b/pypy/doc/project-ideas.rst
@@ -176,28 +176,33 @@
 * `hg`
 
 
-Optimising cpyext (CPython C-API compatibility layer)
------------------------------------------------------
-
-A lot of work has gone into PyPy's implementation of CPython's C-API over
-the last years to let it reach a practical level of compatibility, so that
-C extensions for CPython work on PyPy without major rewrites. However,
-there are still many edges and corner cases where it misbehaves.
-
-The objective of this project is to fix bugs in cpyext and to optimise
-several performance critical parts of it, such as the reference counting
-support and other heavily used C-API functions. The net result would be to
-have CPython extensions run much faster on PyPy than they currently do, or
-to make them work at all if they currently don't. A part of this work would
-be to get cpyext into a shape where it supports running Cython generated
-extensions.
-
 ======================================
 Make more python modules pypy-friendly
 ======================================
 
-Work has been started on a few popular python packages. Here is a partial
-list of good work that needs to be finished:
+A lot of work has gone into PyPy's implementation of CPython's C-API, cpyext,
+over the last years to let it reach a practical level of compatibility, so that
+C extensions for CPython work on PyPy without major rewrites. However, there
+are still many edges and corner cases where it misbehaves.
+
+For any popular extension that does not already advertise full PyPy
+compatibility, it would thus be useful to take a close look at it in order to
+make it fully compatible with PyPy. The general process is something like:
+
+* Run the extension's tests on PyPy and look at the test failures.
+* Some of the failures may be solved by identifying cases where the extension
+  relies on undocumented or internal details of CPython, and rewriting the
+  relevant code to follow documented best practices. Open issues and send pull
+  requests as appropriate given the extension's development process.
+* Other failures may highlight incompatibilities between cpyext and CPython.
+  Please report them to us and try to fix them.
+* Run benchmarks, either provided by the extension developers or created by
+  you. Any case where PyPy is significantly slower than CPython is to be
+  considered a bug and solved as above.
+
+Alternatively, an approach we used to recommend was to rewrite C extensions
+using more pypy-friendly technologies, e.g. cffi. Here is a partial list of
+good work that needs to be finished:
 
 **matplotlib** https://github.com/mattip/matplotlib
 
@@ -223,5 +228,3 @@
 **pyopengl** https://bitbucket.org/duangle/pyopengl-cffi
 
     Status: unknown
-
-


More information about the pypy-commit mailing list