Fri 22 Jun 2007
I’m getting pretty sick of seeing blog posts and mailing lists threads endlessly bemoaning that, “the core developers…are causing a huge risk to the Python community by splitting it asunder for a period of years“. Gloom, doom, pox and peril, blah blah blah.
The language has two choices: either continue to bear the burden of what are now considered poor design decisions (e.g., four forms of raise, syntax ambiguities in except statements) or suck it up and let us try and fix some of these problems. It’s like going to the dentist: it may hurt, but if that minor toothache goes untreated and develops into an abscess, you will wish you were dead.
There are two parts to the transition plan: syntactic transition and semantic transition. For syntactic transition, Guido and I have sunk a lot of time into 2to3, which will translate your Python 2.x code into 3.0’s freshly-polished syntax. When it comes to adjusting your code’s semantics, Python 2.6 will feature a Python 3000 compatibility mode, which when enabled will warn you when you do something that will need to be changed before moving to 3.0. Are these tools perfect? No; that’s the price you pay for using a language as flexible as Python. Are they pretty damn good? Yes. Combined, 2to3 and Python 2.6 will make the vast majority of 2.x -> 3.0 transitions as painless as we can make them. For that last little remnant, the code we simply cannot deal with, that’s what your test suites are for. I have absolutely no pity for anyone trying to migrate to Python 3 without a test suite; you’re doing something fundamentally stupid and we will not bend over backwards to save your dumb ass.
As for the observation that pugs, the Perl 6 compiler, will be able to handle Perl 5 source as input and why oh why can’t Python do that, too: Perl 5-on-Perl 6 is a neat trick born in an intersection of necessity and opportunity. The necessity is there because Perl 6 is a fundamentally different language than Perl 5 (or at least it was the last time I looked; they may have changed their minds over the last week), and Perl’s DWIM mentality would make it prohibitively difficult to mechanically translate the old to the new. Also, the Perl 6 compiler can afford to have a Perl 5 runtime built in because there’s only one (serious) Perl 6 compiler, and so the developer and maintenance cost for this extra runtime is isolated within a single project.
Python simply can’t do that. There are four credible implementations of Python I know of (CPython, Jython, IronPython, PyPy), and we can’t ask each one of these efforts to please please won’t you embed a Python 2 runtime in your system? Not going to happen, ever. Given these circumstances, the best we can do is to have a syntax translator that will work across all implementations, and a semantics checker that’s spec-driven and as implementation-agnostic as possible.
If you think you can do better, show us the code. Talk is cheap.
June 22nd, 2007 at 19:02
I must agree with you. We’ve kept python almost completely backward-compatible for more than a decade. My Python 1.5 scripts still run unchanged, which is nice. But the plan to evolve the language, freed from previous design decisions, has been out there a long time, so this should have blindsided no one.
And in the end, backward compatibility concerns are playing a much larger part than previously envisioned. Having Python2.5/2.6 and Python3.0 installed side-by-side won’t be hard. The complainant you reference obviously won’t be happy until Guido drops the Py3K idea altogether, or at least delivers a personal apology. The rest of us will move forward with our clear migration plan, and our optimism for the next version of Python.
June 22nd, 2007 at 19:14
I agree with you. Also, so keep growing (ie. releasing new versions with new functionality) it is better to have a cleaned up base.
Anyway, the “dirty” migration work can be done by Google SoC students
June 22nd, 2007 at 19:53
Collin, you have now (publicly) joined the cabal of cranky python-dev’ers who have learned that the community will bemoan anything (trick is to figure out when everyone is moaning and thus might be right) and to wield the “put up or shut up” mantra that we have all learned to love in order to shut people up about wild ideas.
Welcome.
June 22nd, 2007 at 23:37
For the record here: I understand the reasons for doing a cleanup. I understand the benefits. I just put the costs in scales on the other end for everybody to see. Eyes open.
Brett: “the community will bemoan anything”
This is true. The community is a very diverse group of people and any change to Python whatsoever will have people who don’t like it. You can’t let that lead you into paralysis. On the other hand, language evolution should be done very cautiously.
“to wield the “put up or shut up” mantra that we have all learned to love in order to shut people up about wild ideas.”
I thought this mantra only worked if I came to the language developers and asked them to add static typing or a JIT or whatever, without actually having any interest in doing any work on it. In this case, the comparatively wild idea of breaking backwards compatibility in a decade and a half old language with multiple implementations is coming from the language developers. You need to get another mantra for this. I’d recommend Bill Clinton’s “I feel your pain”.
Anyway, I understand your annoyance with me. It’s a very understandable response from a group to a perceived outsider. Just don’t exaggarate how annoying I am either, and try to understand where I’m coming from. Thanks.
June 22nd, 2007 at 23:57
I’ve browsed the Python source and actually attempted to take part in core development (and failed). Coding in C, or even producing Python code worthy of inclusion (in terms of style, elegance, and cleanliness) in a core distribution is far from trivial.
If I were hell bent on some direction the language should go, or on some feature I really NEED, I would try to lobby a core developer to represent that viewpoint, or find one that does, rather than demand anything from the core developers as a whole.
It’s great being part of the Python community, but it truly does not need me. GvR himself is often quoted as saying something to the effect of “if you want , by all means use LISP or Ruby or ; it ain’t gonna happen in Python.”
Even if the core developers were the most arrogant so and so’s in the world, I would still, justifyibly, have nothing better to say to them than, “Thank you!”
June 23rd, 2007 at 00:22
“There are four credible implementations of Python I know of (CPython, Jython, IronPython, PyPy), and we can’t ask each one of these efforts to please please won’t you embed a Python 2 runtime in your system?”
As I asked in response to Martijn’s first article, have the Jython, IronPython or PyPy developers even committed to providing compatibility with Python 3.0? Or are they holding off on what would be an even bigger trip through the undergrowth than usual?
June 23rd, 2007 at 01:45
I am not as worried about moving from one version of Python to to the next as some people seem to be. I was recently working on a project with a code base of about 150,000 lines of Python code. We went from Python 2.2 to 2.3 to 2.4 with almost no glitches. The only time we had a code issue was when a developer used a 2.4 feature before everyone had upgraded from 2.3. We had hundreds of machines on both Windows and UNIX in many locations that we couln’t force to upgrade every day. To me, bottom line,2.x are very compatible and I think that 2.6 will translate nicely into 3.x
June 23rd, 2007 at 18:25
The Python 3000 concept has been out there for years. 6-8 years, at least. Why are people afraid of it? It it because it has visual progress and plans, unlike Perl 6? If it stayed in the realm of “the mythical Python 3000″ then it would be the greatest thing since barbecued pineapple.
Python 3000, by my memory, has always been tauted as the version that would not take on backwards compatibility. Sometimes I think that’s a worthy sacrifice. The road map has 2.x releases planned out for the next couple of years anyways.
I welcome and look forward to Python 3000, even though I have no idea when I’ll be able to take proper advantage of it (Zope 3, which I use heavily, has yet to be blessed to even *run* on Python 2.5).
June 23rd, 2007 at 22:46
> As I asked in response to Martijn’s first
> article, have the Jython, IronPython or PyPy > developers even committed to providing
> compatibility with Python 3.0?
Python 3.0 support is on the Jython roadmap:
http://www.jython.org/Project/roadmap.html