News for hackers. Stuff that matters.
Re:PyPy 5.1 released by BuckRogers on Thursday April 21, 2016 @10:11AM (#11542240)
Wow. Just wow. Congrats to the PyPy team. It never stops.

I stopped calling myself a Python programmer sometime ago and started saying I'm a PyPy programmer because this is the future of Python. The underlying basis for PyPy has big implications for a number of dynamic languages though so we should all be cheering it on and contributing.

For those who want better Python3 support, there's only ONE answer so no need to keep begging. Donate more money to the project or donate your talents. Patches welcome!

Re:PyPy 5.1 released by kzrdude on Thursday April 21, 2016 @10:52AM (#11542570)
How can it be the future if Py 3 support is the side project?
Re:PyPy 5.1 released by nikolay on Thursday April 21, 2016 @12:46PM (#11543499)
I can't use PyPy until it implements a real Python 3 version, i.e. one that supports asyncio, which is the real future. Until then, I will just be reading about PyPy on Hacker News and just sighing...

Edit: For everything I use, I try to find an asyncio version - Slack client [0], SSH [1], etc.

[0]: https://github.com/gfreezy/slacker-asyncio/

[1]: https://github.com/ronf/asyncssh

Re:PyPy 5.1 released by ChrisArgyle on Thursday April 21, 2016 @02:06PM (#11544145)
I second the asyncio endorsement. I started using Python 3 just to try out asyncio and never went back. It works like a dream.
Re:PyPy 5.1 released by sp332 on Thursday April 21, 2016 @10:55AM (#11542598)
After they get momentum by attracting people with their speed improvements, it will be a lot easier to attract talent and money to tackle Python 3. The reason Python 3 is on the back burner is that there simply isn't a large enough audience right now. That could change if they keep increasing their reach.
Re:PyPy 5.1 released by poooogles on Thursday April 21, 2016 @12:36PM (#11543408)
>The reason Python 3 is on the back burner is that there simply isn't a large enough audience right now.

Funnily enough the reason I haven't adopted using PyPy is down to their lack of Python3 support. I think you're underestimating the amount of people using Python3.

Re:PyPy 5.1 released by coldtea on Thursday April 21, 2016 @01:02PM (#11543633)
Pip statistics tells us they're not that many.
Re:PyPy 5.1 released by collinmanderson on Friday April 22, 2016 @01:44PM (#11550949)
Do you have any recent statistics?

I'm guessing that most people who use Python 3 are using recent versions of pip that have caching built in, so that may skew the results a bit.

Re:PyPy 5.1 released by coldtea on Friday April 22, 2016 @03:27PM (#11551950)
From this (last year), Python 2.6 is bigger than 3:

https://caremad.io/2015/04/a-year-of-pypi-downloads/

>I'm guessing that most people who use Python 3 are using recent versions of pip that have caching built in, so that may skew the results a bit.

Since pip updates itself too, why wouldn't people using Python 2 also have newer versions?

Re:PyPy 5.1 released by collinmanderson on Saturday April 23, 2016 @08:58AM (#11555360)
I'm guessing a lot of people who are stuck on Python 2.6 are also stuck on old versions of pip.
Re:PyPy 5.1 released by cglace on Thursday April 21, 2016 @12:42PM (#11543461)
I think he means not enough companies willing to sponsor python 3 support.
Re:PyPy 5.1 released by Alupis on Thursday April 21, 2016 @12:34PM (#11543400)
> After they get momentum by attracting people with their speed improvements, it will be a lot easier to attract talent and money to tackle Python 3

Well, this is a catch-22, because folks like me and my team won't touch it unless it's Python 3. We're not a Python shop, but have flirted with Python before. It wouldn't make sense for us to write new code in Python 2.

Re:PyPy 5.1 released by kzrdude on Thursday April 21, 2016 @11:13AM (#11542751)
After they get momentum? But pypy has existed for a long time. They are in a maturity phase now, surely.
Re:PyPy 5.1 released by sp332 on Thursday April 21, 2016 @11:27AM (#11542851)
There are major bug fixes and compatibility and performance improvements in this release. They're also asking for a large amount of money to start a push to add Py 3 support. And NumPy support is still improving - they'll gain a lot of users as that becomes complete. None of this seems like "maturity phase", especially in terms of userbase or funding.
Re:PyPy 5.1 released by LeifCarrotson on Thursday April 21, 2016 @12:22PM (#11543306)
You don't get many cases of 20% memory consumption improvements in mature projects...
Re:PyPy 5.1 released by anc84 on Thursday April 21, 2016 @01:48PM (#11543995)
You should read through PostgreSQL release notes some day.
Re:PyPy 5.1 released by wyldfire on Thursday April 21, 2016 @01:26PM (#11543812)
"20% consumption" is more a factor of how much memory you have installed and how much you intend to use than PyPy's maturity. I frequently use malloc()/mmap() to consume much more than 20% of system memory.

EDIT: strike this, I misunderstood.

Re:PyPy 5.1 released by groovy2shoes on Thursday April 21, 2016 @01:51PM (#11544022)
I think they're talking about a 20% improvement in memory consumption release-over-release, not complaining that it's consuming 20% of their memory.
Re:PyPy 5.1 released by coldtea on Thursday April 21, 2016 @01:00PM (#11543615)
Py 3 is not the future of CPython either. Even today the overwhelming majority of projects use 2, even new projects.
Re:PyPy 5.1 released by X-Istence on Thursday April 21, 2016 @02:48PM (#11544440)
While this has historically been the case, Python 3.4/3.5 has really sped up adoption of Python 3, and from an open source maintainer, Python 3 is making large inroads.

Also, libraries are slowly going to drop Python 2.x support and go Python 3 only.

Re:PyPy 5.1 released by coldtea on Friday April 22, 2016 @03:57AM (#11547660)
>While this has historically been the case, Python 3.4/3.5 has really sped up adoption of Python 3, and from an open source maintainer, Python 3 is making large inroads.

If by great inroads you mean "around 6-10% in PyPI after 8 years of trying", then yes.

But unless it gets over 30-40% it's not anywhere near significant in my charts...

Re:PyPy 5.1 released by takeda on Thursday April 21, 2016 @09:16PM (#11546460)
As soon as Python 2.7 was put in maintenance mode I see much more people talking about Python 3. There are even libraries that are Python 3 only.

All the developers needed was a kick in the butt. If only PSF did that sooner.

Re:PyPy 5.1 released by valarauca1 on Thursday April 21, 2016 @10:54AM (#11542586)
>The underlying basis for PyPy has big implications for a number of dynamic languages

Isn't it just a tracing JIT? Aren't these relatively well understood and implemented dozens of different ways?

Re:PyPy 5.1 released by maxerickson on Thursday April 21, 2016 @10:55AM (#11542600)
The novelty is that the JIT is produced by compiling a simple interpreter.

http://morepypy.blogspot.com/2011/04/tutorial-writing-interp...

Re:PyPy 5.1 released by Alphasite_ on Thursday April 21, 2016 @11:03AM (#11542674)
Others have shown up and take the same approach, Graal and Zippy for example.
Re:PyPy 5.1 released by njharman on Thursday April 21, 2016 @03:31PM (#11544775)
I've never heard of those. Python on the other hand has been my primary professional language for years. i.e. people pay me to program in python.

See how PyPy might be a tinsy bit more relevant / meaningful to professional developers.

Re:PyPy 5.1 released by pjmlp on Thursday April 21, 2016 @04:44PM (#11545206)
Java developers know them quite well. In fact Java 9 is getting a plugin API for Graal.
Re:PyPy 5.1 released by valarauca1 on Thursday April 21, 2016 @11:05AM (#11542682)
I still don't see the novelty.

Its a JIT compiler run-time. You put a program in the JIT-compiler's run-time. And it was JIT compiled. The program you gave it just so happens to have Turning Complete behavior. It doesn't change anything the JIT compiler is doing.

It's like a compiler boot-strapping itself. It seems really impressive, but really the program is just doing its job on an input. The input just happens to be itself.

Re:PyPy 5.1 released by chrisseaton on Thursday April 21, 2016 @12:09PM (#11543209)
> I still don't see the novelty.

Are you familiar of the state of the art in JIT compilers at the time PyPy's JIT was developed? It was absolutely a novel idea at the time, and was published as a novel result in a peer-reviewed paper. I'm not sure how else to convince you of that.

> However, applying an unmodified tracing JIT to a program that is itself a bytecode interpreter results in very limited or no speedup. In this paper we show how to guide tracing JIT compilers to greatly improve the speed of bytecode interpreters. One crucial point is to unroll the bytecode dispatch loop, based on two kinds of hints provided by the implementer of the bytecode interpreter.

> Applying a trace-based optimizer to an interpreter and adding hints to help the tracer produce better results has been tried before in the context of the DynamoRIO project [27], which has been a great inspiration for our work. They achieve the same unrolling of the interpreter loop so that the unrolled version corresponds to the loops in the user pro- gram. However the approach is greatly hindered by the fact that they trace on the machine code level and thus have no high-level information available about the interpreter. This makes it necessary to add quite a large number of hints, be- cause at the assembler level it is not really visible anymore that e.g., a bytecode string is immutable. Also more ad- vanced optimizations like allocation removal would not be possible with that approach.

http://dl.acm.org/citation.cfm?id=1565827

Re:PyPy 5.1 released by fijal on Thursday April 21, 2016 @11:38AM (#11542943)
Did you actually look at the blog post? The novelty is the idea that you generate a JIT compiler from the interpreter using a few hints. Truffle does that, but Truffle is newer than PyPy.
Re:PyPy 5.1 released by sho_hn on Thursday April 21, 2016 @11:21AM (#11542801)
It's not about novelty, it's about realization. PyPy exists and works as both an open source project and as a codebase, which is no easier to achieve than coming up with an idea. That said, PyPy has yet to demonstrate real impact outside the Python community, and projects with a somewhat similar aim to what's being discussed (the Parrot VM) have likewise not gotten to significant uptake. We'll see. PyPy is definitely already useful at other things, though.
Re:PyPy 5.1 released by KingEllis on Thursday April 21, 2016 @11:44AM (#11542998)
> PyPy exists and works as both an open source project and as a codebase, which is no easier to achieve than coming up with an idea.

I have no idea what you are getting at here.

Re:PyPy 5.1 released by sho_hn on Thursday April 21, 2016 @11:54AM (#11543080)
The post I was replying to was misunderstanding "this is new!" as "this is the first time this exists!" when it's more about "this is the first time this is available!", where availability is complex and defined by factors like governance, distribution, quality, accessibility, infrastructure, communication ... these are the things that tend to be make or break long after novelty had its moment.

Whether "this is the first time this is available!" is true or not is open to debate (it depends in part on how you weigh the listed concerns), but parent's post didn't read on it.

Re:PyPy 5.1 released by valarauca1 on Thursday April 21, 2016 @12:02PM (#11543152)
So you just adding a user program to a REPL/Parser and cramming it into a JIT?

You can do this in Javascript, or LLVM-IR just as easily.

The main blessing is also its biggest curse. You are writing a language to move fast, and change often. Its a good learning tool, but a constantly changing language is next to impossible to build value upon.