[Cython] Rewriting/compiling parts of CPython's stdlib in Cython

Robert Bradshaw robertwb at math.washington.edu
Tue Mar 29 02:09:08 CEST 2011

On Sun, Mar 27, 2011 at 3:39 PM, Sturla Molden <sturla at molden.no> wrote:
> Den 25.03.2011 19:03, skrev Robert Bradshaw:
>>>> Looking at Guido's comment, Cython must be able to compile all valid
>>>> Python if this will have any chance of success.
>> Good thing that's our goal (pending an actual definition of "all valid
>> Python.")
> In lack of a Python language specification it can be hard to tell
> implementation details from syntax. It sounded though as if Guido was
> worried about Cython's compatibility with Python, and maybe the Cython dev
> team's attitude to Python compatibility.

We are very concerned about Python compatibility.

> Also don't think Cython's main strength in this context was properly
> clarified in the debate. It is easy to over-focus on "speed", when it's
> really a matter of "writing Python C extensions easily" -- i.e. without
> knowing (a lot) about Python's C API, not having to worry about reference
> counting, and the possibility of using Python code as prototype. Cython is,
> without comparison, the easiest way of writing C extensions for Python.
> FWIW, it's easier to use Cython than ctypes. Using Cython instead of the C
> API will also avoid many programming errors, because a compiler does fewer
> mistakes than a human. Those aspects are important to communicate, not just
> "Cython can be as fast as C++".

That is a good point. On the other hand, I don't see re-implementing
working C modules written, though probably valuable from a maintenance
point of view, as compelling of a use case.

- Robert

More information about the cython-devel mailing list