Hacker News new | ask | show | jobs
by ramanujan 5284 days ago
This might be a contrary view, but Cython has been ready for production for quite a while while PyPy has still been getting its boots on:

http://cython.org/

It actually works right out of the box. You can download it and get real world examples to work in five minutes. It works with C++. It works with numpy.

http://wiki.cython.org/WrappingCPlusPlus

http://wiki.cython.org/tutorials/numpy

It's the real deal: ridiculously easy to use as a drop-in replacement for slow functions. It works on problems that are not toys. It allows you to use high performance C and C++ libraries, it's used in a large and well maintained project (sage), and development was at least partially funded by Google.

With all due respect to Maciej for his work, PyPy has been in the works for many years now, and projects like that don't tend to ship -- or to meet expectations if they actually do ship.

2 comments

I think you are being unfair. PyPy is something you can use on your code without modifying your code. That's a big thing. And by big I mean huge. Paying someone $70/hour to modify code is expensive. Switching "python" executable with "pypy" is a lot cheaper than profiling code then re-writing it in Cython. Yeah you might still end up having to do that but who knows, you might not have to or you might even be running faster than C (yes in theory jit compiler could do that).
Seriously, pypy outperforms Cython in pretty much all cases unless you provide type informations and even then, pypy is often faster. Complex projects, like twisted or django tend to have a flat performance profile - in order to run them reasonably fast, you would need to put types everywhere and very likely convert classes to C structs. This is not going to fly and you know it, cython is only useful for people inside numeric community.

Also, it's true that pypy took many years to build, but it actually does work. If you claim that pypy never shipped, it very likely means none of the "new python interpreter" projects would ever ship for you, but hey, there are people out there for whom it works.

Cheers, fijal