Is python not good enough?

Stefan Behnel stefan_ml at behnel.de
Sun Jan 17 11:01:18 EST 2010


Paul Rubin, 17.01.2010 05:06:
> David Cournapeau writes:
> 
>> And certainly, one of the big reason for
>> the python success is easy interface with C. Maybe interfacing with C
>> is the real reason for holding back python implementations ?
> 
> The CPython/C API is not terrible but it's not all that easy to use.
> For example, it's very easy to make reference counting errors.  Other
> language FFI's that I've used avoid that problem to some extent.

Other languages don't have Cython.


> It's true that CPython has quite a few existing C modules that would require
> rework if the API were to change incompatibly.

"quite a few" sounds a bit too weak here. Some of the existing C extensions
have become reasons to use Python in the first place. Think of NumPy, for
example, and the whole scipy environment. Think of the
performance-to-usability ratio of cElementTree and lxml. Think of the huge
body of Cython code in Sage. Imagine what the set of dbm modules (or even
the entire standard library) would be without external C libraries and C
extensions.

The C-API and the ton of modules that use it are pretty vital for Python.
AFAICT, Py3 is pretty much a virgin platform when it comes to scientific
computing, mostly because NumPy still wasn't adapted to the changes in the
C-API. They even consider rewriting parts of it in Cython a simpler way to
solve this issue than trying to port the code itself. This shows that any
change to that API may have a tremendous effect on the usability of Python
as a whole.


> But I think a different
> (better) API wouldn't stop people from writing new modules.

"Writing new modules" may not be enough.

Stefan



More information about the Python-list mailing list