News for hackers. Stuff that matters.
Re:Python 3 in Science: the great migration has begun by rhodysurf on Saturday May 09, 2015 @07:03PM (#9518014)
The C extensions shouldnt be cut out of Python. I get that PyPy is better but cutting out c sxtensions and rewriting them in pure python would hurt performance more.
Re:Python 3 in Science: the great migration has begun by dalke on Saturday May 09, 2015 @07:14PM (#9518037)
There are several other options. The extension can be written as a pure C extension, with CFFI for the bindings, and code in Python to present the public API. Or write the extension in Cython, which has backends for both CPython and PyPy's cpyext (I have no experience with this option).
Re:Python 3 in Science: the great migration has begun by reipahb on Saturday May 09, 2015 @07:20PM (#9518056)
Personally, I would really like to see more Python extensions written using the ctypes foreign function library. This has two advantages:

* Supported on more than just CPython. I.e. you can use them on PyPy as well.

* The extensions are far easier to install, since one doesn't need both a full C compiler as well as all development headers for the library installed on the server where you install the extension.

Re:Python 3 in Science: the great migration has begun by fdej on Saturday May 09, 2015 @08:23PM (#9518197)
ctypes overhead is horrendous though, at least in CPython (I don't know about PyPy). Fine if you're doing array operations on huge arrays, but not so if you have lots of small objects.

I wanted to use ctypes to wrap a C library for a recent project (for the ease of installation and development that you mention) but had to give up when it turned out to be more than 10x slower than a wrapper written in Cython, and barely faster than doing a pure Python implementation of the C library itself.

Re:Python 3 in Science: the great migration has begun by JulianWasTaken on Saturday May 09, 2015 @07:23PM (#9518061)
It's unclear that that's true (that performance would be worse), but regardless, there are many other, better ways to run C code from within Python (CFFI being the easiest and nicest currently)