r/programming • u/rguillebert • May 09 '13
PyPy 2.0 Released
http://morepypy.blogspot.com/2013/05/pypy-20-einstein-sandwich.html3
u/thejollysin May 09 '13
The last I heard was that PyPy hadn't reached its full goal of being 100% Python. How close are they now to getting rid their dependence on C completely?
19
u/dacjames May 09 '13
Do you mean supporting 100% of Python? Or written 100% in Python? They are very, very close to the former goal, excluding CPython extension compatibility. Essentially any pure python program works in PyPy unless it relies on CPython implementation details, the most common being reference counting.
The latter was never a goal of the PyPy. It's always been written in a slightly less dynamic subset of Python called RPython, which is translated to C, then compiled. Some very low level details are written in C directly, but that happens less and less as the translation improves.
-5
u/thejollysin May 09 '13
If they aren't interested in PyPy being written 100% in Python, then what is the goal of the project? I mean, that was why I was interested in PyPy. We already have something that supports 100% of Python, you know?
Well, I will download it and play with it anyway. Can't wait.
31
14
u/dacjames May 10 '13
RPython is quite similar to Python; you loose some of the most dynamic features (like metaclasses), but it's still a lot easier to write than C.
Implimentation flexibility is only half of the reason for PyPy. The other is the JIT compiler, which is generated automatically from the RPython interpreter and offers significant (2-200x) speedups over CPython.
I can't wait for Numpy support so I can start using it for my projects at work.
4
u/thejollysin May 10 '13
Okay, I'm a convert. I'll start playing around with it tonight.
A faster NumPy/Python would make a big difference at my work as well.
6
u/kankyo May 10 '13
I'd like to clarify a thing about RPython just to make sure everyone is on the same page: All RPython programs (including PyPy) are Python programs. Meaning you can run the PyPy code on CPython, or you can translate it to C and then compile that. So in a way PyPY is indeed 100% python, it just can't use all of python, just the subset they call rpython (r for restricted).
1
u/X8qV May 11 '13
My god, does this thing take long to build. I've been waiting for three hours now.
1
u/Liverotto May 15 '13
Can someone explain to me why JITed code is way faster than PyPy compile to C?
Take a look at the benchmarks: http://speed.pypy.org/timeline/#/?exe=3,1&base=2+472&ben=float&env=1&revs=200&equid=off
If the same algorithms were rewrote in RPython then to C and then to native code would they still be slower than JITed code?
8
u/cloudaday May 10 '13
I would love to pick the brain(s) of the guys on this project. I met one of them when he came to talk to my undergrad project advisor and he was fascinating.