Python Creator Scripts Inside Google

By eweek  |  Posted 2006-03-06

Python Creator Scripts Inside Google

The Python language, used for a growing range of utility and application development tasks, bears the personal stamp of language creator Guido van Rossum. On the eve of this years Python developer conference, eWEEK Technology Editor Peter Coffee spoke with van Rossum about the tools current state and future prospects.

Thanks for talking with us. We understand that at the end of last year, you joined the staff at Google in a role that devotes half your time to Python development. So, what do they call you there?

They call me Guido. I dont have a title, other than member of the technical staff. When people talk about Python informally, they may refer to me as GVR or BDFL, the joke title of Benevolent Dictator for Life that I have in the Python community.

How did you wind up at Google? Whats the affinity between Google and Python?

Google has made no secret of the fact they use Python a lot for a number of internal projects. Even knowing that, once I was an employee, I was amazed at how much Python code there actually is in the Google source code system.

A Microsoft-branded version of the IronPython programming language is moving full-speed ahead toward final delivery. Click here to read more.

That doesnt mean that when you are doing your Web search or Google News, or anything of that order, youre interacting with Web servers running Python programs—but a lot of the maintenance, a lot of the developer support and a lot of the back-office applications like advertising use an awful lot of Python. Inside Google, Python is the standard scripting language.

How do you feel about the label of "scripting language"? Some people feel it is becoming dated because of the growing use of incremental compilation and other dynamic technologies in mainstream development.

Within Google, its reasonable to talk about scripting as a category because the majority of applications are written in C++ and Java. In general, scripting languages gain programmer productivity by giving up program efficiency. There are other languages that do the same thing that clearly arent scripting languages: If you want to talk categories, its better to talk about very high-level languages that go beyond C++ or Java.

What makes Python an exemplar of a very high-level language?

Python does away with a lot of the endless bookkeeping that you find in C++ and Java—saying 10 times over that your variable is a list of integers, things like that. Built into the language are more data types with more operations, giving you a more expressive and concise notation for dealing with those things.

Do you feel there were any assumptions you made or preconceived notions you had that got baked into Python? If so, what would you go back and tell yourself—if you had a time machine available—not to do?

We were stuck for a long time in some choices that I made between machine integers and arbitrary-precision integers. Were slowly getting rid of that, but its a relatively painful process because, over time, the exact semantics of small integers and long integers had become slightly different. If you add two numbers, the result is pretty obvious, but, in some cases, such as bitwise operations there are some corner cases.

Once you have an installed base, and there are lines of code that are written and working, any change—no matter how well-intentioned—will break someones code, and you have to be careful about that.

Are there any particular milestones that developers should be expecting the Python development process to reach in the near future?

The currently active release is 2.4, actually 2.4.2, but the last digit is only relevant for bug fix tracking. Were working on 2.5 now, which will have a number of new language features. Weve selected those; some have not yet been implemented. At the [PyCon] conference [in Dallas at the end of February], well get a group together to implement the missing features and start a cycle of alpha releases, two betas, a release candidate, and a final release date of September or October.

Next Page: Whats next for Python?

Whats Next for Python


We tried to get an early look at the PyCon proceedings and were told that there would not be any produced. Is it a pretty informal event?

PyCon is a grass-roots conference. At some point, in the 1999 to 2000 era, we tried to make it a little more ambitious. The price point wasnt right for that community: Weve gone back to a grass-roots conference and been very successful that way.

What will be the major new features in Version 2.5?

Those are in a document called PEP 356, Python Enhancement Proposal 356. Those PEP documents are on the Web site [at].

What do you consider to be the key features?

People who make rash judgments, who reject a language because of any one missing feature arent generally worth catering to. Theyll always find something. But if you had any misgivings about the lack of a conditional expression in Python, 2.5 will have one [as described by PEP 308]. Thats sometimes the right thing in cases where a developer doesnt want a train of thought interrupted. Its not a particularly big deal in my eyes.

Click here to read about how toolmakers are responding to the boom in scripting.

For Python developers who have been using the language for a long time, probably the introduction of a "with" statement is more interesting. It makes it much easier for the programmer to do the right thing with locks or with opening and closing files or with database transactions that you want to be sure succeeded. Thats a language feature thats been long in the making, and Im very happy with the outcome—with the result of the design [described in PEP 343].

What made that a difficult process?

It was striking the right balance between a feature that was sufficiently general without inviting abuse or obfuscated code. One proposal that didnt make it had the possibility that whatever object was in the top of the "with" statement might execute the body of the statement multiple times: an incredibly powerful feature, with all sorts of wonderful things you might do with it. But most of the use cases that people actually could come up with didnt involve looping—and the possibility was considered too magical and surprising to the reader of the code.

If we could look out as far as, say, 2010, are there directions that youd be happy to see Python taking?

The major next revision of the language is "Python 3000." Thats been elusive because Python 2.x has been successful and because Ive been employed by people using Python rather than developing the language itself. At Google, Im excited to be able to start developing Python 3000 for real.

Thats defined by PEP 3000; sometimes we jump out of the numeric order [of PEP designations]. The problem with integers that I mentioned, that will be solved in Python 3000 once and for all. Issues with division, which differs between integers and floating-point types, will be resolved. That was another early mistake in the language design thats made for a difficult recovery.

Is the time frame for a usable Python 3000 in the next two or three years?

Id be very disappointed if we didnt have something executable, a close approximation to Python 3000, in the next two or three years.

What else will open new pathways for Pythons use?

I expect that there will be compilers that will cause Python program execution to be significantly faster than it is. More and more people are starting to learn how to do it.

Check out eWEEK.coms for the latest news, reviews and analysis in programming environments and developer tools.

Rocket Fuel