Unladen Swallow: Python 3’s Best Feature.

January 6th, 2010 § 24 comments § permalink

holy-shit-awesome-2.jpgWe all know (well — unless you’ve under a rock) about Unladen-Swallow, the semi-Google-Sponsored optimization-focused branch of Python 2.x. Collin, Jef­frey and many oth­ers have been work­ing tire­lessly on port­ing the CPython inter­preter over to LLVM, apply­ing opti­miza­tion patches, writ­ing tests, etc all aimed at speed­ing up real-world oper­a­tions and code since before last year’s PyCon — at that time, the first release was already work­ing hard, ren­der­ing YouTube’s tem­plates. (See the Project Plan for more information)

You prob­a­bly also saw the 2009Q3 testing/performance results (here), show­ing a hefty speed increase for var­i­ous oper­a­tion. The 2009Q4 will be com­ing soon.

What you prob­a­bly don’t know — yet, is that a PEP is com­ing, propos­ing Unladen Swal­low be merged back to Python-core — specif­i­cally, the Python 3k branch. Yeah, that’s right — a PEP to merge Unladen Swal­low back into the moth­er­ship, but to Py3k only. Talk about a shot in the arm!

Quot­ing Collin Winter:

Python 3 is the nat­ural place for some­thing like Unladen Swal­low to land: Python 3 is clearly the future, and I think improved per­for­mance will be a strong sell­ing point in the language’s favor. What we and oth­ers have done for Python 2 applies directly to Python 3.

One of the things we’ve really focused on with Unladen Swal­low is cre­at­ing a solid foun­da­tion that the wider CPython devel­oper com­mu­nity can build on top of. We’ve fixed some nasty prob­lems in the x86-64 JIT, for exam­ple, so that the CPython com­mu­nity can focus on the fun stuff — more opti­miza­tions! Hav­ing the basic JIT infra­struc­ture in place and well-tested opens up a world of oppor­tu­ni­ties that didn’t exist before.

I think PyPy’s focus on research is incred­i­bly valu­able. Unladen Swal­low has always been about, “what can we achieve right now?” One of our guid­ing prin­ci­ples has been, Do noth­ing orig­i­nal, don’t be inno­v­a­tive. PyPy is look­ing 10 years down the road and think­ing, What can we do if we ques­tion every­thing? I think hav­ing those dif­fer­ent per­spec­tives is impor­tant to the com­mu­nity. So, no, I don’t see us in com­pe­ti­tion (with PyPy) at all.

There’s been a lot of talk about how slow adop­tion of 3k has been — a back­wards incom­pat­i­ble imple­men­ta­tion of a widely used lan­guage will always have slow(er) adop­tion then releases of the same lan­guage, back­wards com­pat­i­ble — but I’d argue that to an extent, part of the rea­son is that there “haven’t been enough car­rots” in the Py3k cart to pro­vide enough of an incen­tive for projects, libraries, etc to move to it at an accel­er­ated rate.

This, well — this changes things. A sig­nif­i­cantly faster inter­preter, a more ratio­nal GIL thanks to Antoine Pitrou — these are the improve­ments to Python 3 which make it the per­fect tar­get to aim for for new projects and libraries. It should dras­ti­cally help pro­vide the impe­tus for larger libraries to move over. Things like these are exactly why some­thing like the mora­to­rium make sense, efforts can be focused on the ecosys­tem of python out­side of the syn­tax, on the inter­preter, the stan­dard library, etc.

This is huge; and with a lit­tle luck, a lot of dis­cus­sion and debate — and a ton of work, by the end of 2010, we’ll have not only the best imple­men­ta­tion of Python, as a lan­guage to date in Python 3 — but the best inter­preter as well.

The PEP should go out for review soon, prob­a­bly within the next two weeks — and more details/information will be com­ing out at PyCon in Feb­ru­ary (you’re com­ing, right?!).

Also see Michael Foord’s post about this news too.

Where am I?

You are currently viewing the archives for January, 2010 at jessenoller.com.