9 ms·
PyPy gets funding from Mozilla for Python 3.5 support
- ceronman 10y agoThese are fantastic news. Right now, PyPy is probable the biggest reason why many users don't migrate to Python 3 yet. Python 3 comes with a lot of very nice language features, but even when CPython 3 is already faster than 2.x in most cases, these speed increments are very small compared with the speedups of PyPy, which in my experience brings Python's speed to NodeJS level. I'm looking forward for their first release!
- radarsat1 10y ago> Right now, PyPy is probable the biggest reason why many users don't migrate to Python 3 yet. Does PyPy have that many users?
- pinaraf 10y agoWell, it weights in favor of Python 2, and considering that until recently the incencitives for Python 3 were still light... It's not really about having users, but having the possibility of switching from CPython to PyPy if you face performance issues.
- brianwawok 10y agoDoesn't seem that way to me. For actual real world apps with a lot of IO, your PyPy benefit is kinda small. For actual number crunching, I guess. Which is the whole scientific side of Python. Python is weird that it is 50% webapp hipsters ala Ruby, and 50% scientists in lab coats sitting in the lab crunching.
- rjeli 10y agoWell, PyPy does not actually help much with raw number crunching -- a scientist will use numpy for native matrix math, or numba to JIT a tight loop that can't be writted in numpy easily. PyPy really helps in the in-between cases: a few weeks ago I had to write a script to pull a few million rows from a database, process them nontrivially, and dump them to a file. What do I use here? CPython and Ruby will take days. Perl will probably take days, unless I am just doing text processing which perl is optimized for. I can write C or C++, and have the headache of debugging memory errors in a script that will only run once. Or, I can write PyPy and have immensely convenient syntax that will run reasonably quickly (Luajit also occupies this space for me).
- brianwawok 10y agoWell if this task is trivial to parallelize.. I would spin up 100 GCE machines for 1 penny each per hour after today's price drop (combined total of $1 per hour for 100 CPUs of action).. and pull those few million files and dump to a cloud drive in 1 hour flat. It's a tricky sweet spot PyPy has. Certain tasks that need CPU power but not too much CPU power and you want to spend time to make it run in parallel but not too much time to make it run across many machines. (By no means am I a PyPy or CPython expert. Just toyed with them and want to understand the bounds...)
- zardeh 10y agoBut now you have to manage that deployment which is also nontrivial.
- 10y ago
- StavrosK 10y ago> brings Python's speed to NodeJS level Does anyone have a benchmark? I hear this claim a lot, but I haven't seen NodeJS being that much faster.
- eeZi 10y agoNodeJS/V8 is faster than CPython for obvious reasons - V8 is JIT compiled while CPython is not. PyPy closes the gap.
- john_reel 10y agoLuaJIT made the news for having an interpreter that beat V8’s JIT a while ago. There are a lot of traits about languages and their implementations that makes looking at their compiler features a poor way of determining speed.
- mutagen 10y agoThe Techempower benchmarks show them each having their strengths, with 3 'wins' apiece: https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=plaintext&l=1s0 https://www.techempower.com/benchmarks/#section=data-r12&hw=... The usual Techempower caveats apply: I have no idea about the implementations or any possible constraints on these, YMMV.
- StavrosK 10y agoThank you, that seems useful. I must be reading it wrong, though, because I see wsgi completing three times more responses than node.js, which seems wrong. I also can't find the "three wins each" that you reference. EDIT: Ah, I just noticed the different benchmark tabs at the top, thanks.
- zzleeper 10y agoSimilarly, Python 3.5 is (for me and probably others) the biggest reason for not using PyPy
- eeZi 10y agoAgreed. Looking forward to the 3.5 port.
- zyngaro 10y agoYou mean you don't use 3.5 be cause pypy does not support it.
- techdragon 10y agoNo, it seems like they are in the same position as myself. They (and myself) are not using PyPy because PyPy does not support Python 3.5
- michwill 10y agoI wonder if uvloop will work with such pypy. The speed would be awesome!
- brettcannon 10y agoIt's a possibility. uvloop is written in Cython so it will depend on whether PyPy3 supports what uvloop uses through Cython: http://docs.cython.org/en/latest/src/userguide/pypy.html http://docs.cython.org/en/latest/src/userguide/pypy.html
- 1st1 10y agoWe'll find a way. Worst case it's possible to rewrite it using cffi.
- rantanplan 10y ago> Right now, PyPy is probable the biggest reason why many users don't migrate to Python 3 yet I've met hundreds of pythonistas, in all sorts of different places. A lot of them wanted to migrate to Python 3.X not a single one told me that PyPy was a reason.
- epidemian 10y agoI fall in that camp too. I worked on a project where i really wanted to migrate to Python 3, mostly to have a saner Unicode story, but couldn't do it because it was deployed on Google App Engine :(
- sciurus 10y agoYou may already know, but you can use 3.4 if you switch from the "Standard Environment" to the "Flexible Environment". https://cloud.google.com/appengine/docs/flexible/ https://cloud.google.com/appengine/docs/flexible/
- epidemian 10y agoYep. Already tried that, but i found too many disadvantages on the "flexible" environment (still in beta, bad documentation, much slower deploys, minimum of one instance always running, etc) that i preferred to stay out of that for the time being.
- hyperbovine 10y agoWeird how suddenly everyone seems to have coalesced around 3.5. I myself have experienced this just recently -- the new async stuff is too nice to pass up. Really looking forward to new formatted string literals in 3.6 as well! One of those ideas that's so obvious in hindsight, you can't believe it took us this long to come up with it.
- plorkyeran 10y agoOne of the arguments against switching to Python 3 has always been that you just don't gain enough to justify the hassle, so maybe 3.5 finally hit that critical mass of things people really want.
- StavrosK 10y agoDon't gain enough? Static type checking and asyncio? Sign me up!
- pinaraf 10y agoStatic checking ? Python 3.5 Asyncio ? Python 3.4 If these had been available in Python 3.2 or even better 3.0, the switch would have been far easier for corporate users that need benefits before accepting the cost of change...
- raverbashing 10y ago3.4. gave a good virtualenv by default. That helps a lot
- brianwawok 10y agoI still use normal virtualenv, what am I missing by not using pyenv?
- raverbashing 10y ago
- RodericDay 10y agoThis thread presents a great opportunity for someone to sweep in and present a foolproof path to persuade enthusiastic newbies to jump in and help...
- Animats 10y agoWhy is Mozilla doing this? They're already doing Rust, and their products don't use Python internally. The build process for Mozilla add-ons was even converted from Python to Javascript to eliminate Python from the build chain. I'd rather see Mozilla support Thunderbird, which is useful.
- jonwayne 10y agoMozilla's websites notably use Python and Django.
- phonon 10y agoTheir site(s) are using python extensively. https://blog.mozilla.org/webdev/2013/02/22/the-restful-marketplace/ https://blog.mozilla.org/webdev/2013/02/22/the-restful-marke...
- mintplant 10y agoThe code push infrastructure also runs on PyPy specifically: https://github.com/mozilla-services/autopush https://github.com/mozilla-services/autopush
- Etzos 10y agoIn addition to their sites (which have already been mentioned), their build tool "mach" uses Python[1]. [1] https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/mach https://developer.mozilla.org/en-US/docs/Mozilla/Developer_g...
- jgraham 10y agoPedantry time: mach isn't a build tool, it's a command dispatch framework. So yes, |mach build| will build Firefox (or servo), but, for example, |mach try| will push code to the try server, and |mach mdn| will search MDN. However to address the original point, Python is indeed widely used at Mozilla, not just for websites but for test harnesses, build tools, analysis scripts, etc. It wouldn't surprise me if it was second to only to javascript on the basis of "number of developers who have written >0 lines of code in this language for Mozilla projects".
- amyjess 10y agoOh thank goodness. The last thing that would make me consider using Python 2 for new projects is about to go away.
- brachi 10y agoI'm glad to hear about this funding. It's also a reminder for myself to bring the topic to my company about donating to open source.
- Aeolos 10y agoI'd love to switch to PyPy, but Theano doesn't seem to be supported, Tensorflow is an unknown. Does anyone know what is the limiting factor for supporting deep learning frameworks on PyPy?
- pas 10y agoWhy would you ... umm, use pypy with these frameworks? After all they do the heavy lifting via very specialized low-level libraries, right? So python is just the glue holding together and driving the data pipeline.