Guido van Rossum Interviewed 226
Qa1 writes "Guido von Rossum, creator of Python, was recently interviewed by the folks at O'Reilly Network.
In this interview he discusses his view of the future of Python and the Open Source community and programming languages in general. Some more personal stuff is also mentioned, like his recent job change (including the Slashdot story about it) and a little about how he manages to fit developing Python into his busy schedule."
Python (Score:2, Interesting)
Can anyone (Score:3, Interesting)
Re:Can anyone (Score:3, Interesting)
If you are using Java then python is a step up because it offers first class functions and some other incredibly power constructs.
Unfortunately, although Python's effort is applaudable, it really is only a first class imperative language that has added some features of Lisp [paulgraham.com].
If you are going to chose a new language to learn, then you should be learning Lisp. Most people avoid it because it looks complicated but, believe me, after using in for many years, Lisp is gorgeous.
I highly suggest you check out Paul Graham's website [paulgraham.com] and read his articles about Lisp before you waste anytime learning any other language.
All languages nowadays are slowly adding individual pieces of Lisp functionality. Why not just use Lisp (no reason to wait a decade for all the "popular" languages to finally come fill circle and become Lisp dialects).
Python vs. the others (Score:3, Interesting)
Many people use Python for tasks they used to do in Perl, but I don't see Python replacing Perl. They serve different purposes, for the most part.
Ruby is also an interesting language, although I don't personally know much about it, except that it aims to be truly OO. Again, slightly different purposes, but I don't think Ruby will ever be very widespread.
Re:Can anyone (Score:5, Interesting)
o Python uses indentation to denote code blocks, rather than curly brackets {} or other methods. This, along with a few other layout rules, makes Python code very strictly laid out. This makes it both easy to read and code, and you really don't miss being able to use your own crazy layouts (ahhh, perl
o Python is totally object orientated, and very intelligently designed in this department. Whereas in Perl (5) you have to jump through hoops to create objects, especially OO modules, in Python it's as easy as assigning a variable a new value.
o Python has quite a few very useful built in object types, including strings, ints, floats, lists, tuples, dictionaries, functions, classes, and more. This makes things easy if you don't want to make complex matrices. It is also easy to make more complicated types by embedding C...
o It is really easy to embed C/C++ code in Python, and vice versa, so where Python suffers on performance you can boost it with C/C++, or use a Python tool appropriately called "boost"
Generally, Python is very handy for anything from one-time dirty scripts to full applications (there are some good GUI toolkit ports about.. PyGtk, PyQt, PyKDE, wxWindows, etc), and is also very handy when developing prototypes.
But what really makes me like Python (as I'm not a language nerd by any measure) is that it is just *easy* and *fast* to code in... it doesn't get in your way.
(Pimping out...)
Is Python still lacking a macro system? (Score:3, Interesting)
I haven't been following python for a long time, though I've used it for a few projects. I know a lot of Lisp-like features such as lambda, eval, etc. have been added to it. (Java's adding a *lot* of features that Dylan has had since its inception, such as keyword arguments... but adding those features to Java makes the language even more ugly.) But what about a real macro system (and I don't mean a C style macro system)? I assume that it would be difficult to incorporate into Python because the Python syntax is not as consistent as the Lisp-family languages.
I assume that Python is still not efficiently compilable either, right? I think Guido was discussing a sealing mechanism for Python similar to Dylan's. Gywdion Dylan can produce code that's as fast as code written in C... and there's still many more optimizations that can be implemented into the compiler.
Re:Can anyone (Score:5, Interesting)
Python, Perl and Ruby are all very good interpreted, flexible, rapid-prototyping languages. They all have their relative strengths and weaknesses, but all are good enough that if you are choosing between them, it boils down pretty much to your own preferences and what coworkers and other people around you use (or on what animal you prefer on the cover of your reference literature:) ).
If you mean this class of languages as opposed to C, C++, Java and so on, well, it becomes a matter of what you want to accomplish. The great benefits of these interpreted languages are that they make development very fast, compared to the more traditional languages (yes, Java is interpreted, but it is still designed as a traditional language). You spend more time solving your task and less time managing the mechanics of development. Also, they really make use of the benefits of being interpreted with things like closures, dynamic code evaluation and so on. And they typically have very complete, transparent access to the surrounding system - why spend two days writing some hairy functionality when you can trivially filter your data through an external application that already does the whole job for you? Do not underestimate "scripting type glue".
They do make a pretty good fit running large systems - the Swedish pension management system is all written in Perl, for instance, and Zope is written in Python. They are also quite efficient; they are on the whole as fast as a Java implementation, and occasionally (when the task plays to the specific language's strengths), quite a bit faster.
I typically use C/C++ and Perl for development, and every time I've been using Perl for a while, I get bouts of frustration with traditional languages for the lack of such things as hash datatypes and inline regular expressions. But for some tasks, traditional languages are the way to go.
Favorite quote (Score:2, Interesting)
Re:Is Python still lacking a macro system? (Score:5, Interesting)
You don't need macros since Python is dynamically typed and even functions are first-class objects. At least I know I never missed the C preprocessor after moving to Python
I assume that Python is still not efficiently compilable either, right?
Not quite. There is however a dynamic compiler called Psyco [sourceforge.net], which works by creating static versions of functions at run-time to reduce type-checking.
My own experience is that Psyco makes Python code about 400% faster in real applications. Still an order of magnitude worse than C, but comparable to or better than other languages when it comes to tasks that Python used to do significantly slower.
My experiences (Score:3, Interesting)
I've been a Python user myself and I find it quite remarkable how it has evolved since its 1.5.2 to the pointer where they are now 2.3. More and more (interesting) software is being written for it. But evenly important is the code base of Python. It's C implementation is very clean written and very easy to use so one can write extension modules very fast.
This is mine (Score:3, Interesting)
GvR: That's a deep philosophical question. I'm optimistic about that in theory.
[...]
Given that I believe everybody can learn to read and write, given the right education and circumstances--obviously if your parents have no money and you're sent to work when you're seven years old, you're not in a very good situation unless you're exceptionally smart--I believe that the same thing would be possible for programming and thinking logically to some extent.
Re:Python - Python in a nutshell (Score:3, Interesting)
My recomendation:
Python in a Nutshell by Alex Martelli
Hands dow the best introduction to Python from a programmer's prespective. That is if you are already familiar with basic programming concepts. The great thing about the book is that covers just about every aspect in an extremely concise way that does not bore you to death.
I'm a certified Java and XML developer, gave up on Perl long time ago, discovered Python, somehow got over my initial suspicions regarding the whitespace ... within two weeks it became my favorite language. I do just about everything in Python and it takes about 80% less effort. Love it baby!
Quote of the week from the python newsgroup:
"What can I do with Python that I can't do with C#?
You can go home on time at the end of the day." -- Daniel Klein
h
Re:Can anyone (Score:5, Interesting)
I'm a professional C++ programmer, and a devout pythonista. What I miss most in C++ are the easy-to-instantiate datatypes like tuples. It's so much easier to pass a relatively simple datatype as a tuple, as opposed to introducing a whole new class and even *gasp* a new file to do the trick.
For example I can trivially code a function that returns an array of (name, address) tuples, and I can easily manipulate such an array:
tuples = get_address_entries()
for name,address in tuples:
print name,"lives in",address
After doing Python for a while, one sees how much static typing gets in your way of doing things the "proper" way, and very often one tries to avoid doing the damn thing at all... resulting in a sub-optimal design. Python allows you to be all you can be
Re:Python vs. the others (Score:3, Interesting)
Python focuses more on OO issues and the Pythonic way. Perl is more versatile in terms of syntax.
Basically, there's some differences in the overall design philosophy.
But you are right. You can easily use Python for things you used to do in Perl and vice versa. But there are still things I'd rather use Perl for than Python.
Re:Can anyone (Score:3, Interesting)
Python, Perl and Ruby are all very good interpreted, flexible, rapid-prototyping languages. They all have their relative strengths and weaknesses, but all are good enough that if you are choosing between them, it boils down pretty much to your own preferences and what coworkers and other people around you use (or on what animal you prefer on the cover of your reference literature:) ).
I don't think that is really true. How cheap and easy is it to make a COM object or Java class in Perl? What if you want to work with Unicode. Would Ruby be up to it? The truth is that about half of my Python work is really not the sort of thing that even Perl evangelists tend to do in Perl.
Re:Can anyone (Score:1, Interesting)
I've heard this line of reasoning before. For me, the biggest thing against lisp is the absolutely awful syntax - that is, that many close parens begin to hurt the eyes.
I've often wondered how succesful a language would be that simply took all of the abilities of lisp and presented them in a way that's easier for C/C++ programmers to use and read.
Re:Can anyone (Score:4, Interesting)
More and more, I'm thinking corporate America is decades behind what the academic world takes for granted. XSLT, for example, is something that never should have happened. And its not just Lisp. Take, for example, DAML+OIL. Its an XML-based language that can make statements in first order logic that can be verified by a theorem prover. Its so complicated and verbose, that its nearly impossible to write by hand, and most people use GUI tools to work wih it. In the next version, they're adding support for limited execution capability (ala XSLT). Meanwhile, I'm thinking, "hello --- Haskell?"
*> My impression of this mainly comes from comp.lang.lisp. I find some of the people who hang out there to be among the rudest I've seen on the Internet. Some pricks, like Eric Naggum (search for "arrogant" on c.l.c in Google Groups and see who gets the first 20 hits...) are actually revered for their rudeness! It might just be there are more math/pure-science types on that board, and while they're definately smart, they can also be rather rude.
Re:Dump the significant whitespace! (Score:2, Interesting)
In python, it is always 8 spaces. It's considered bad style to use tab. If you use emacs, then emacs will automatically use the correct settings in python mode.
The simple fact is that if you ignore the usual style guidelines for any programming language, there are obvious gotchas. The whitespace gotchas you mention are relatively harmless, as they are caught by the compiler.
There is no way to tell!
There are a lot of ways to tell. For example, in vim, :set list displays tabs as ^I and displays a $ sign on the end of each line.
You can't type in a program printed on paper and be sure that you got the whitespace right.
Spoken like someone who's never tried. Seriously -- never had a problem with this.
Often you can't even be sure that you will get the same whitespace if the program is distributed over the internet as text.
Save to file, and whitespace is preserved.
Until Python replaces significant whitespace with printable characters, it will always be a poor second to Perl in my book.
Pleasing anonymous morons is not one of the design goals of python. Sorry.
Re:Can anyone (Score:1, Interesting)
Re:C++ and tuples (Score:3, Interesting)
Yes, I have written code like this, and generally like STL (too bad I can't use any of it for my work). However, it requires quite a lot of typing, and the resulting code is not as easy to understand.
Three lines of Python, three lines of C++ (barring the typedef, which is only there to make the rest of it easier to read).
And therein lies the catch, typedef is needed.
Great for the occasional programmer (Score:4, Interesting)
I don't get to program much, since I have a day job, and to make matters worse, my formal training with computers was brief. Basically, I learned Python on public transport, communiting to and from work (the Python Cookbook causes people to turn their heads, by the way). I tried learning Java at one point, but the problem is that there are too many details and formalisms that you have to remember to even get anything off the ground.
Not so with Python. Basically, you just write what you want to code. Want to know if there are characters in a string?
(This is new in Python 2.3, and I can't get the indentation to work here). Fantastically intuitive.
The only "problem" is the way the library keeps growing from release to release: Something that you had to code yourself a while back suddenly is a trivial feature. More of an embarrassment of riches than a real problem, but it does make you feel like a fool sometimes. "Why code that socket server? Just use..."
One other nice thing about learning Python is how amazingly friendly and helpful their tutor list [python.org] is. I've asked some amazingly stupid questions in my time, and they have been very gentle and kind.