303 points · by mattip · 11y ago · 144 comments
For me, targeting development on PyPy has taken the place of migrating to Python3. Which just moves too fast in effort to pull people over, Python is too big for that strategy. At this point, people want speed with a great language, they want PyPy! The PyPy team has pretty much enabled the perfect development stack. I use PyPy+Django+gunicorn+Nginx and no problems.
Keep up the great work.
As annoying as the transition to Python 3 is, it's the future of the language. I was actually one of the curmudgeons who stuck with 2.7 and grumbled about not wanting to switch until a few months ago. I've accepted that I need to, at the very least, start new projects in Python 3 wherever possible. The vast majority of popular third party libraries have been ported over at this point. Python 2's death is inevitable, even if it will take many more years.
Let me warn you. If you persist with your propaganda on Python3, then GOLANG will be the future of Python. Does that register with you guys?
Nobody who uses Python 2.7 all day every day thinks it has any of these imaginary "worts" you 3.x guys like to pitch incessantly.
If prestige and money are desirable things, absolute no brainer if they have a business bone in their bodies. It would also secure the future of the stack for everyone concerned with Python3 threatening to cut off Python2. It could also enable a bigger return on those of us who have invested financially into PyPy development. It would certainly snowball even more financial investment.
It would then be the CPython3 project's move. Abandon and integrate all the non-breaking Python3 features into 2.7? Or just move forward with a significantly weaker and less relevant project, working against their past selves? I don't think most would really care and it's best they just move away with their own project.
Could be on the way judging from the favorable naming convention, PyPy4? Has a nice ring to it.
"the Python2.7 compatible release — PyPy 4.0.0 — (`what's new in PyPy4.0.0?`_)"
"the Python3.2.5 compatible release — PyPy3 2.4.0 — (what's new in PyPy3 2.4.0?)."
The PyPy gods are in an enviable position for sure. If they seize the opportunity it's the chance of a lifetime.
I don't get this hate for Python 3. Yeah some things changed, yeah having a big codebase in Py2 sucks if you don't have the time/resources to switch, but starting new projects in Py3 by default is awesome. Asyncio and async/await are fantastic and worth the switch alone.
The most popular package(s) that don't work with it have been numpy, scipy, etc. When I first encountered pypy, there was a numpypy and I wouldn't be surprised if that's different now. But bottom line, tons of python code out there needs more performance and has no dependency on numpy or any C extensions.
What they need is nice JIT engines like PyPy and not to switch languages.
If no one invested in improving implementations for modern languages and switched to something lower level all the time, we would still be using Fortran for business applications.
Personally I LOVE Python but I always feel it is the 2nd best choice. I do use Python but it rarely is the best tool to use for the problem you are solving. Maybe Pypy will turn this around, and I hope so.
Actually, the time-critical loops are usually implemented in C or Fortran. Much of SciPy is a thin layer of code on top of the scientific routines that are freely available at http://www.netlib.org/. Netlib is a huge repository of incredibly valuable and robust scientific algorithms written in C and Fortran. It would be silly to rewrite these algorithms and would take years to debug them. SciPy uses a variety of methods to generate “wrappers” around these algorithms so that they can be used in Python. Some wrappers were generated by hand coding them in C. The rest were generated using either SWIG or f2py. Some of the newer contributions to SciPy are either written entirely or wrapped with Cython.
A second answer is that for difficult problems, a better algorithm can make a tremendous difference in the time it takes to solve a problem. So using scipy’s built-in algorithms may be much faster than a simple algorithm coded in C.
http://www.scipy.org/scipylib/faq.html#how-can-scipy-be-fast...
For me business applications are what you would use Cobol, Clipper, Java, Delphi, C#, Eifel, ....
Of course Fortran makes sense for number crushing, but that is the language domain, not doing CRUD, ETL or distributed computing stuff (not counting MPI here).
The thing is I've never found another developer that new about it, something is very wrong...
This doesn't match my experience of the PyPy project. I found a tiny bug in the stdlib matching against CPython, went into IRC to ask a question about test running to be sure I got it right and was quickly engaged in conversation about why I was running core tests. Next thing I know my small bug has been fixed by a core developer and my chance to contribute is gone.
I'll stick to being a user.
Here are the public IRC logs for what I assume you're referring to (which is from July 2014 by the way):
https://botbot.me/freenode/pypy/2014-07-02/?msg=17362202&pag...
You found a bug in an old version of PyPy. A core developer told you you might want to try a new one. No one stole your shot out from under you.
You would undoubtedly be welcomed to contribute. Don't post FUD.
Disclaimer: I am not a PyPy core dev but I do work closely with them.
> I'll push this change quickly
> Alex_Gaynor - uhh, wait the check seems to exist?
I dunno, I kinda see both sides here. First, I don't think the devs were off-base at all here. They were friendly and looking to solve problems. However, they did seem to want to simply solve the problem, while Matthew did state that he was looking at this as a way to contribute.
The whole interaction could have been improved with a little encouragement at the end, and possibly a recommendation of an 'easy' bug that was currently in need of a fix. It was fairly clear that there was an enthusiastic new contributor, so a little effort in this direction may have been warranted.
I certainly would consider this an example of being unfriendly or unwelcoming.
The fact that I wanted to run tests and couldn't, and the team went on to why I wanted to run tests and looked to solve my problem is my complaint.
Also, to be clear, I'm not trying to say the PyPy channel is unfriendly, it certainly isn't. It's just not set up to help potential new contributors get started.
Here's Neovim's "entry-level" label, for example:
https://github.com/neovim/neovim/issues?q=is%3Aopen+is%3Aiss...
https://github.com/rust-lang/rust/issues?q=is%3Aopen+is%3Ais...
Fixed a bug the same day someone asked about it and some potential contribute blame you for not letting them fix entry level bug.
Answering people with "patch welcome" and people blame you for not fixing it.
Our vectorizing JIT can use SIMD semantics on all numpy looping calls. For instance, non-matrix multiply A*B or for ndarray + scalar calls
While many numpy users are in the habit of manipulating large square matrices, there is a significant number of users who use small arrays, or process RGB pixels
Seems like a huge improvement, don't know if it's the recent additions or in general pypy vs cpython but it's enough of a speed bump to sit up and take note.
import numpy as np
%timeit sum(np.sum(np.random.randint(0, 10000000, 5000)) for i in range(5000))
1 loops, best of 3: 586 ms per loopThat's very good news, since monetary contributions don't seem to be abunding (none of the goals have been met according to pypy.org). Maybe it's a marketing issue, like said before?
Thanks for all the effort made.
In any case the 3.3 branch seemed good when I compiled it last, it'd be nice to see a partial release.
If I were the PyPy guys I'd just announce that PyPy was now officially a fork of 2.7. This would bring all the numerical guys with them, all the corpos with big investments in 2 would fund them, and we could then let the 3.x zealots go off on their own tangent.
Anybody who likes what 3.x brings to the table should really spend a weekend learning Go, which does it all better, and faster.
I've been saying in these threads for ages that vectorization is the big win in Python (thank you PyPy), and not hobby projects like asyncio (miles better elsewhere), or (eyes rolling) type annotations.
Where are those blog posts?
According to wikipedia: https://en.wikipedia.org/wiki/Tracing_just-in-time_compilati...
Tracing just-in-time compilation is a technique used by virtual machines to optimize the execution of a program at runtime. This is done by recording a linear sequence of frequently executed operations, compiling them to native machine code and executing them. This is opposed to traditional just-in-time (JIT) compilers that work on a per-method basis.
[1]:https://en.wikipedia.org/wiki/Tracing_just-in-time_compilati...
It's a JIT that traces runtime execution, rather than looking at whole method or function bodies. In particular it eliminates control flow, which simplifies optimisation.
Basically you observe loops and loops that satisfy certain criteria are traced, that is all operations performed within one iteration are stored. Such a trace is then optimized, compiled to machine code and then executed for every iteration when the loop is encountered again.
I've read that a few times and I always come away confused -- it sounds like a huge fundamental type change needs to be made by someone well versed in the PyPy internals. i.e. not something you'd typically defer to an external contributor.
I'd like to experiment with PyPy and PyParallel, but I'm basically exclusively 64-bit Windows, so it sounds like a non-starter.