News for hackers. Stuff that matters.
Re:PyPy gets funding from Mozilla for Python 3.5 support by ceronman on Tuesday August 09, 2016 @03:03PM (#12256982)
These 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!
Re:PyPy gets funding from Mozilla for Python 3.5 support by rantanplan on Tuesday August 09, 2016 @05:27PM (#12257828)
> 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.

Re:PyPy gets funding from Mozilla for Python 3.5 support by epidemian on Tuesday August 09, 2016 @11:22PM (#12259315)
I 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 :(
Re:PyPy gets funding from Mozilla for Python 3.5 support by sciurus on Wednesday August 10, 2016 @10:27AM (#12261997)
You 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/

Re:PyPy gets funding from Mozilla for Python 3.5 support by epidemian on Wednesday August 10, 2016 @10:38AM (#12262080)
Yep. 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.
Re:PyPy gets funding from Mozilla for Python 3.5 support by zzleeper on Tuesday August 09, 2016 @04:22PM (#12257436)
Similarly, Python 3.5 is (for me and probably others) the biggest reason for not using PyPy
Re:PyPy gets funding from Mozilla for Python 3.5 support by eeZi on Tuesday August 09, 2016 @07:09PM (#12258331)
Agreed. Looking forward to the 3.5 port.
Re:PyPy gets funding from Mozilla for Python 3.5 support by zyngaro on Tuesday August 09, 2016 @07:26PM (#12258386)
You mean you don't use 3.5 be cause pypy does not support it.
Re:PyPy gets funding from Mozilla for Python 3.5 support by techdragon on Tuesday August 09, 2016 @09:30PM (#12258913)
No, 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

Re:PyPy gets funding from Mozilla for Python 3.5 support by StavrosK on Tuesday August 09, 2016 @03:25PM (#12257127)
> 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.

Re:PyPy gets funding from Mozilla for Python 3.5 support by mutagen on Wednesday August 10, 2016 @01:53AM (#12259752)
The Techempower benchmarks show them each having their strengths, with 3 'wins' apiece:

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.

Re:PyPy gets funding from Mozilla for Python 3.5 support by StavrosK on Wednesday August 10, 2016 @09:17AM (#12261413)
Thank 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.

Re:PyPy gets funding from Mozilla for Python 3.5 support by eeZi on Tuesday August 09, 2016 @07:10PM (#12258336)
NodeJS/V8 is faster than CPython for obvious reasons - V8 is JIT compiled while CPython is not. PyPy closes the gap.
Re:PyPy gets funding from Mozilla for Python 3.5 support by john_reel on Thursday August 11, 2016 @01:54PM (#12270326)
LuaJIT 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.
Re:PyPy gets funding from Mozilla for Python 3.5 support by radarsat1 on Tuesday August 09, 2016 @03:09PM (#12257030)
> Right now, PyPy is probable the biggest reason why many users don't migrate to Python 3 yet.

Does PyPy have that many users?

Re:PyPy gets funding from Mozilla for Python 3.5 support by brianwawok on Tuesday August 09, 2016 @04:43PM (#12257577)
Doesn'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.

Re:PyPy gets funding from Mozilla for Python 3.5 support by rjeli on Tuesday August 09, 2016 @06:23PM (#12258136)
Well, 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).
Re:PyPy gets funding from Mozilla for Python 3.5 support by brianwawok on Tuesday August 09, 2016 @08:16PM (#12258633)
Well 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...)

Re:PyPy gets funding from Mozilla for Python 3.5 support by zardeh on Tuesday August 09, 2016 @08:34PM (#12258698)
But now you have to manage that deployment which is also nontrivial.
Re:PyPy gets funding from Mozilla for Python 3.5 support by brianwawok on Wednesday August 10, 2016 @09:41AM (#12261616)
Depends on your setup I guess? I have a a GCE cluster setup where I can:

1) Point a metadata variable at my git repo

2) Spin up 100 GCEs

3) Each will pip install requirements.txt from the git checkout

4) Each will read a metadata to get the command and run it. (Could hardcode run.py or something).

Realize not everyone has this sitting around, but you can do it in an afternoon. Then gives you instant Python supercomputer for anything you want across many projects.

Re:PyPy gets funding from Mozilla for Python 3.5 support by zardeh on Wednesday August 10, 2016 @01:10PM (#12263286)
The setup for that sounds significantly nontrivial, although interesting.
Re:PyPy gets funding from Mozilla for Python 3.5 support by dr_zoidberg on Tuesday August 09, 2016 @06:32PM (#12258178)
Scientific Python benefits more from (properly) vectorized numpy code, Cython, Numba and Numexpr than what it gains from PyPy.

From my experience, one of the biggest issues with PyPy is that it's not a magic pill you take and suddenly all your Python code runs faster -- that's how they "sell" it. But in many cases, the idiomatic code for CPython results in slow PyPy execution, and idiomatic PyPy code results in slow(er) CPython execution.

That means that you have to refactor your code, and whereas you won't be breaking compatibility with CPython, your CPython performance will (most often) suffer. So, unless you're the sole user of your code, or you have control or decision power over most of your users, (or you just don't care to keep good CPython performance) your project might not benefit: "yeah, in PyPy it runs 2x faster, but 80% of our clients use CPython and are complaining over a 5x slow down -- ditch that code and get back to the previous version" may end up being the feedback from someone above you in hierarchy.

Re:PyPy gets funding from Mozilla for Python 3.5 support by eeZi on Tuesday August 09, 2016 @07:11PM (#12258338)
> Python is weird that it is 50% webapp hipsters ala Ruby, and 50% scientists in lab coats sitting in the lab crunching.

Don't forget about the ops guys using it for automation!

Re:PyPy gets funding from Mozilla for Python 3.5 support by brianwawok on Tuesday August 09, 2016 @08:17PM (#12258639)
Oh yes my ansible brothers and their lack of Python3 support ;)
Re:PyPy gets funding from Mozilla for Python 3.5 support by kasey_junk on Tuesday August 09, 2016 @09:41PM (#12258964)
Where brothers == inbred cousins
Re:PyPy gets funding from Mozilla for Python 3.5 support by brianwawok on Wednesday August 10, 2016 @09:38AM (#12261593)
Hahaha kinda.. but if Ansible brothers are inbred cousins, Puppet and Chef brothers are certified insane asylum.
Re:PyPy gets funding from Mozilla for Python 3.5 support by pinaraf on Tuesday August 09, 2016 @03:14PM (#12257060)
Well, 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.
Re:PyPy gets funding from Mozilla for Python 3.5 support by joejev on Tuesday August 09, 2016 @03:23PM (#12257111)
PyPy is still not really a performance option for numerical computing.
Re:PyPy gets funding from Mozilla for Python 3.5 support by xapata on Tuesday August 09, 2016 @06:43PM (#12258217)
Are you not satisfied with NumPy and associated tools?
Re:PyPy gets funding from Mozilla for Python 3.5 support by dagw on Wednesday August 10, 2016 @03:47AM (#12260129)
Very satisfied, and that is why I can't really switch to PyPy
Re:PyPy gets funding from Mozilla for Python 3.5 support by michwill on Tuesday August 09, 2016 @04:38PM (#12257548)
I wonder if uvloop will work with such pypy. The speed would be awesome!
Re:PyPy gets funding from Mozilla for Python 3.5 support by brettcannon on Tuesday August 09, 2016 @05:23PM (#12257793)
It'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
Re:PyPy gets funding from Mozilla for Python 3.5 support by 1st1 on Tuesday August 09, 2016 @11:47PM (#12259391)
We'll find a way. Worst case it's possible to rewrite it using cffi.