PyPy2.7 and PyPy3.5 v5.7 released
morepypy.blogspot.com
morepypy.blogspot.com
Does anyone know why it still hasn't managed to get enough traction to become the official path for the language, and why it still needs mozilla support to get funds ? My intuition is that it's just too complex. But haskell,scala,swift and rust also have a lot of complexity so that can't be the only reason.
Do you mean to refer to the Global Interpreter Lock as the factor which prevents it from becoming the official path for the language? CPython, the reference implementation, has the GIL as well.
Or the PIL library (though everyone seems to use Pillow now?)
I'd wager BDFL prefers the CPython implementation because it's probably simpler. Also, it supports tons of targets and is super simple to build.
It's healthy for a language to have more than one implementation. A big win would be a linux distro selecting pypy for use as the default Python. But IMO many python scripts that folks use just don't run long enough to see a benefit from PyPy.
At a EuroPython Keynote, the BDFL mentioned that he hasn't had a closer look at PyPy (he mentioned downloading it and playing with it for a few minutes). I.e. there is a certain disinterest. Also, remember that the "Zen of Python" (https://www.python.org/dev/peps/pep-0020/#id3) was written about the design principles of the Python interpreter, and PyPy is not exactly the Zen of python.
Personally, I'd love to see Python 4 to be based entirely on PyPy.
You're doing good wagering, Guido mentioned just this at several keynotes (source: skim through his PyCon/EuroPython keynotes, there's a good chance he addresses the point or answers a question about it). I'd paraphrase him with: although now a big project with optimizations here and there obscuring the purpose of many parts, CPython remains a boring well-understood "no rocket science" C project. As an example of this, I remember him mentioning how the opcode dispatcher remains a giant `switch` statement rather than something more intricate.
That doesn't mean he dislikes or wants to hinder PyPy (or IronPython or Jython or Pyston or ...), just that he's fine with CPython reach and trade-offs as the "default python", and if you prefer another Python with different performance/compatibility/featureset/xyz characteristics, you're welcome to grab it :)
* Is most up-to-date and has all the latest features * Everyone is most familiar with * Already is packaged in all operating systems * Is the most stable * Is compatible with all C extensions
One reason is that CPython is kept relatively simple on purpose, so it abstains from implementing things like a jit or other very complex optimizations. The biggest obstacle for pypy adoption is that it can't serve as a drop in replacement in the majority of cases, be it because its behind (until now far behind) in supporting new versions of the language or because a lot of popular packages rely on C extensions. The CPython way of binding to C on which these packages rely on does not fit the architecture of pypy very well so they did not really support it at all until recently.
The people who really care about Python performance (sci. comp & HPC) are the ones driving the (non-)adoption of PyPy. One, the existing solution (CPython + Cython) is pretty mature. Two, they require the holy trinity: Numpy, Scipy and Matplotlib. None of these are supported on PyPy, and only Numpy is even close.
That said, the cpython+cython solution is not going away any time soon.
Care to elaborate? I agree that numpypy is pretty much complete, though I have not found it to be faster in my limited testing. I was under the impression that a great deal of work would be required to get the other two running, even using CPyExt (which would not be faster, which was the whole point to begin with). I'd love to be proved wrong though.
PyPy2 can now import and run many C-extension packages, among the most notable are Numpy, Cython, and Pandas. Performance may be slower than CPython, especially for frequently-called short C functions. Please let us know if your use case is slow, we have ideas how to make things faster but need real-world examples (not micro-benchmarks) of problematic code.
I've tried optimizing sympy and it's hard - there is a chance that it uses cython (which will slow things down on pypy) but also the gains were small (up to 2x) and only noticable if you run it for a while (at least few seconds).
SymPy is a bit of an example that while python as a language is not necesarilly slow, since you can make a plan for most parts, it breeds culture of unnecessary meta-programming, tons of copies and dict lookups that makes it REALLY HARD to optimize. ORMs go in the same category
The problem besides the jit not being able to inline external functions is that the CPython structures, and especially the refcounting used in CPython is problematic [1]
[0]: Actually specifically numpy is being rewritten in PyPy as a RPython Mixed Module: http://doc.pypy.org/en/latest/extending.html#rpython-mixed-m... [1]: http://doc.pypy.org/en/latest/discussion/rawrefcount.html
Perhaps it's almost time for some numpy / pandas stuff in speed.pypy.org :)
However, when running the linux binaries on CentOS, they both (32- and 64-bit) fail for me with shared library errors:
./pypy2-v5.7.0-linux32/bin/pypy: error while loading shared libraries: libexpat.so.1: cannot open shared object file: No such file or directory
The 64-bit version gives the same library error but regarding libssl.so.1.0.0. I verified that I do have both expat and openssl installed (using yum), although I don't think that should be needed anyway. Anyone know what is happening here?
"[1]: stating it again: the Linux binaries are provided for the distributions listed here. If your distribution is not exactly [Ubuntu 12.04 and 14.04], it won't work, you will probably see: pypy: error while loading shared libraries: …. Unless you want to hack a lot, try out the portable Linux binaries." https://github.com/squeaky-pl/portable-pypy#portable-pypy-di...
One question to PyPy developers: CPython 3.5 [1] introduced math.gcd which uses Lehmer's algorithm [2], are there any plans to include it in PyPy, too?
[1] https://bugs.python.org/issue22486 [2] https://en.wikipedia.org/wiki/Lehmer%27s_GCD_algorithm
Yes, absolutely. This is why it's marked as "beta", so not absolutely all the features are implemented.
Definitely something I'll be looking into more.
Because of these people doing work for the ecosystem in 10 years we will still see this monstruosity: "for python2 do this and for python3 do this"
For this release PyPy2 shipped with binaries for 11 platforms, PyPy3 shipped with 1.
What I'm trying to suggest is that the amount they've received to support Python 3 ($250,000 from Mozilla, $66,677 in public donations) is signal that there is major demand for this.
Could they use the infra that is building binaries for PyPy2 for PyPy3?
I understand where they are coming from "Existing project are using Python2" but I'd like to see them focus more on the future.
I love what PyPy is doing and I want them to succeed but I can't imagine their success coming out of Python2. I see them more competing with more modern performant languages that are currently stealing from Python (i.e Go/Rust).
If they focused on the future they could directly compete in that market of projects that are rewriting in other languages for performance.