Guido van Rossum created the Python language, which is one of a multitude of popular dynamic languages available these days, used by organizations like Google and NASA. Last Sunday, van Rossum, a staff software engineer at Google, presented at the PyCon conference in Silicon Valley, then talked with InfoWorld Editor at Large Paul Krill, elaborating on Python and responding to critics.
[ See InfoWorld's recent interview with Bjarne Stroustrup, inventor of C++, covering the latest the language has to offer. | For more news on software development, subscribe to InfoWorld's Developer World newsletter. ]
InfoWorld: You answered critics who said that Python is too slow. You said every time you try to write something in Python, it is fast enough. Why is there criticism that it is too slow?
Van Rossum: What people of course do is they pick a tool and they build something incredible, and as part of the incredible thing they're building, they're doing crazy stuff, and sometimes some of the crazy stuff involves doing a whole bunch of computation, crawling through a graph of a billion social contacts or analyzing a trillion email messages or whatever.
At some point, you end up with one little piece of your system, as a whole, where you end up spending all your time. If you write that just as a sort of simple-minded Python loop, at some point you will see that that is the bottleneck in your system. It is usually much more effective to take that one piece and replace that one function or module with a little bit of code you wrote in C or C++ rather than rewriting your entire system in a faster language, because for most of what you're doing, the speed of the language is irrelevant.
InfoWorld: Which is the current version of the language?
Van Rossum: There are two different versions out right now. There are two branches of the language that we're trying to unify eventually. We're trying to kill off the Python 2 branch, so that the last leaf on the Python 2 branch is Python 2.7. But you still see a lot of Python 2.6 and 2.5. With the Python 3 branch, the current release is 3.2, and we just released an alpha of 3.3, so in a few months, 3.3 will be available.
InfoWorld: What's the main attraction of the Python 3 branch?
Van Rossum: Python 2 had accumulated multiple ways of doing the same thing. Also, Python 2 had introduced a way of dealing with Unicode; when we introduced it in 2000, we were very proud of our Unicode support and the way it was backward-compatible. By the time 2006-07 rolled along, we realized that we needed a completely different approach to Unicode, and we couldn't come up with a way of making that new correct approach to Unicode compatible with the old version of the language.
That was one thing that made us think that instead of having point releases that are constrained by pretty severe compatibility requirements, let's have one new release, Python 3. We're going to clean up a bunch of things and we're going to throw away features that were already deprecated. Users will know Python 3 is incompatible with Python 2, but it feels still like pretty much the same language.
InfoWorld: If it's incompatible, do you have to recompile your Python 2 apps?