Thursday, July 27, 2006

OSCON: Day two part 2

Next up was the Python 3000 talk by Guido van Rossum, the creator of Python. Python 3000 is the next-generation version of the Python language, really just Python 3.0. His approach is to leverage existing Python features while dropping deprecated or buggy design elements. All this while avoiding what he calls "an accidental paradigm shift."

He also doesn't want Python 3000 to get caught up in process and become "the next Perl 6." That got a nervous giggle from the audience. The first alpha will probably come along in early 2007, with the first release coming about a year later. Guido also expects a 3.1/3.2 release a few months after that, once wider use exposes more issues.

So what will change? Well new keywords can be added. Many builtins that formerly returned lists will return iterators. All strings will be unicode, supplemented with a new mutable "bytes" data type. The binary file I/O will be redesigned. '<>' will be dropped as an alias for '!=' (you mean there was MORE THAN ONE way to do it?).

Code migration was discussed as well. Since perfect mechanical translation is out of the question (too many changes are semantic, not syntactic). Guido expects that an automated tool could get most of the way, possibly augmented by a version of Python 2.x that complains about deprecated code.

Since Python 3000 is still a young idea, few things have been decided for certain. Guido doesn't want to change the look and feel of Python, so most of the work will go into fixing imperfect or deprecated features from the language and API. Besides unicode strings, another change will be from integer to float division. Importing will be absolute. These are all important features, but they're not very exciting. Unfortunately much more is known about what won't be in Python 3 rather than what will.

Some syntactic changes: Backticks will go. I like what's going to happen to list comprehensions. Basically they lose the square braces and become "generator comprehensions," but you can still wrap them in braces to coerce to a list. Clever. And lambda lives! Turns out they haven't yet found a suitable replacement after a year of looking, so Guido gave up ("It's as good as it gets, trust me!").

I have to admit that OSCON has cemented my excited about Perl and Ruby over Python. It's possible that having a BDFL is working against Python as a language.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home