Guido van Rossum Interviewed
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."
That's what says in the link to the Python tutorial. It's quite good to get you to know the language and does not require a lot of previous programming experience. Then, the library reference can come very handy too.
-- Repeat with me: "There is no right to profits".
I learnt from the book "Python Essential Reference" - see Amazon's page. It has an excellent first chapter which will give you an excellent grasp of the fundamentals. Good luck, and have fun :o)
$ strings FTP.EXE | grep Copyright
@(#) Copyright (c) 1983 The Regents of the University of California.
I highly recommend Dive into Python, a free online book that's targeted at experienced programmers.
Sure you can do the same things in other languages, at the end all general languages are Turing Machine equivalent. The difference is that Python is EASY to read (according to Master Yoda). It is bottom-up designed to be.
So it is good not only for scripting, but too for prototyping and for everything which needs to be flexible and not too much efficiency-critical. The logic of some videogames is encoded in Python, you know.
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
its like perl, but coherent.
its fast for parsing, yes perl is faster. but for most people 75,000 lines of text in 3.01 seconds is just as good as 90,000 lines, considering the python code is easy to deal with.
You might find Eric S. Raymond's take on the question quite informative.
Note: my knowledge of python is somewhat limited as I just started using it, so if there are errors here, I apologize.
1. Python as a scripting language has several features seen in Objective C(and other similar languages) not found in C++. Class members can be detected and bound at runtime, further it's possible to search a classes members for information.
2. Pydoc and documentation strings. Python has built in support for documentation strings, and a great utility for automatically generating documentation. Documentation is actually a part of the programming language, and not an after-market add-on.
3. Dictionary objects, tuples, lists - are all part of the basic language. Dictionary objects allow interesting hash tables to be created without much effort at all. This feature is seen in Perl.
4. Maybe a miss feature, but enforced indentation creates much easier to read code.
5a. The shelf object. This essentially allows any object to have it's runtime information stored in an easy and effecient matter. It can then be reloaded after a run.
5b. The pickle object again allows objects to easily be stored in files.
6. Python is _EXTREMELY_ easy to extend using the Python C API.
7. Python includes functional programming aspects such as mapping and lambda forms.
8. Python includes an extremely complete library that does just about everything one would desire to be able to do. Using the python runtime library allows your code to be easily portable without the headaches involved in C/C++ porting.
9. Using psyco, it's possible to have Python code JIT on i386 processors. This gives a significant performace boost.
10. A development community and support community second to none.
There are other aspects that I haven't touched on here, but these are the major things I've found helpful so far.
As a CS major, the intro CS classes at my school recently switched from teaching Java to Python. The class is designed to teach the fundamentals of computer science and computer pogramming. Python is extremely easy to learn, and quite powerful. We used the free text How to Think Like a Computer Scientist as the course textbook. I recommend this text to anyone interested in learning Python as a first programming language.
A Game Development Series book titled "Game Scripting Mastery" shows how to incorporate Python into a game scripting project. Yeah, I know this is a plug, but this book is a prime example of a known open source project being used as a teaching tool.
There is one caveat to this book though--it uses other scripting languages also, but it does provide a dedicated chapter for Python.
Game Scripting Mastery
Python is available for the regular Zuarus OS as well.
Just because you're paranoid does not mean that the world is not full of assholes.
Concerning advantages of Phython
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.
Alright, lets set something straight here. The world is on a huge object oriented high. As has been said about strict types, object oriented programming is a hammer and everything all of a sudden looks like a nail.
Any language that is *only* objected oriented is forcing you to look at everything as nails.
Try Lisp, you'll feel much better.
(Insert language here) is just a watered down Lisp.
> You don't need macros since Python is dynamically
:-)
> typed and even functions are first-class objects.
You don't even know what you are missing.
Lisp and Dylan are dynamically typed with functions as first class objects. However those features are orthogonal to a true macro system... They're not related. A true macro system allows a capable programmer to extend the language itself. Need a new control struct to lock a resource and then automatically unlock it at the end of the block of code? Well you can just write one yourself if you have real macros.
There's a fairly detailed interview with bruce eckel ("famous" guy who has written c++ and java books and sits on the C++ standards committee) at artima on why he likes python (I linked to the last part of the article series, since that contains links to the previous ones).
From the Learning Python book (see sec. 1.1.1.1):
So, while Python supports object oriented programming, it doesn't force you to use it.
Frogs are primitive animals - so the occasional extra toe is not that unusual. But this is very unusual.
> You are right that there is no good free
> cross-platform implementation of Common Lisp
GNU CLISP Unix, DOS, OS/2, Windows, Amiga, Acorn, Mac platforms.
From the site:
CLISP includes an interpreter, a compiler, almost all of CLOS, a foreign language interface and a socket interface. An X11 interface is available through CLX and Garnet. Command line editing is provided by readline.
CLISP runs on microcomputers (OS/2, Windows 95/98/2000/NT, Amiga 500-4000, Acorn RISC PC) as well as on Unix workstations (GNU/Linux, BSD, SVR4, Sun4, DEC Alpha OSF, HP-UX, NeXTstep, SGI, AIX, Sun3 and others) and needs only 2 MB of RAM.
CLISP is Free Software and may be distributed under the terms of GNU GPL. You may distribute commercial applications compiled with CLISP, see file COPYRIGHT in the CLISP distribution.
The user interface comes in German, English, French, Spanish, Dutch and Russian, and can be changed at run time.
OOP is a part of Python the way that OOP is part of C++.
It's available if you want to use it, but you're not forced to
use it when it's not appropriate.
*sigh* back to work...
Python already works on 64-bit systems.
Java is almost never interpreted these days. Its loaded as virtual machine byte code, then dynamically profiles, optimized and run as high-performance native code in almost all situations. High quality VMs (such as those from IBM) can run many Java apps as fast as C/C++. Saying that perl/python and other scripting languages beat Java in terms of speed is simply typical Slashdot anti-java FUD.
It's a great reference. I taught myself quite a bit of Python from scratch using only that "book". Very clear, and very comprehensive. The fact that it's free, and downloadable in a variety of forms, just makes it even better.
Surnames starting with "Van" ("from") are Dutch, like Guido.
"Von" is the German version. Dutch people don't like to be taken for Germans, for historical reasons..
Also, this is just a nit pick but, while I realize that Python is a big subject, I dislike how often this book mentions something only to conclude "but I don't cover that here." Why tell me what you're not going to tell me? Just tell me what you are going to tell me. I can do the 'subtraction' myself.
Personally, I have found that the best way for me to begin learning Python and to continue to learn Python is to check out the documentation, google for specific questions, and experiment for the rest. Experimenting is especially handy and productive given the Python interactive interpreter (especially when coupled with the bash shell history). While there may be other languages/interpreters which allow you to do so, Python is the only language/interpreter I know of which allows you to design GUIs on the fly, adding and configuring elements from the command line: Which brings up another point. I have yet to find a really good source for Tkinter info -- neither a good tutorial nor a good reference. My main source of info to date is to use the following tricks. If, for instance, I want to find what I can do with the button in the example above, I do this. I would greatly appreciate it if someone could point me to a quality Tkinter reference.
On page 2 of interview:
"Perl, Python, Ruby and Tcl are the four dynamic programming languages that get the most publicity as open source projects, and I think they have a lot more in common than they differ."
Hello? Language Usage Estimates (based on Google searches).
Depending where you look, PHP gets far more publicity than Python, Ruby and Tcl put together, for example: Head-to-Head: PHP vs. ASP.NET.
Quit being some kind of language snob. PHP may not be the greatest language ever designed but it's highly popular and aside from web sites, does a reasonable job on the command line and is capable of simple desktop apps: PHP-GTK.
More to the point, alongside Apache, it's one of the main things holding off the Beast from domination of the Internet.
van Rossum :
parent poster (Slothrup) :
Yes, I was also surprised at this large factual error.
GPL Version 2 : June 1991
GPL Version 1 : February 1989
Earlier forms of Copyleft licenses also existed from before 1989. The Free Software Foundation was founded in 1985 and has of course always released its work as 'Free Software'.
p.s. Slothrup, I suggest evening tea at Miss Quoad's would be a suitable punishment for van Rossum's inaccuracy. As a man who named his language after an English comedy group, I'm sure he has the required sensibility to appreciate the full horror of this particular engagement.
Not really. 2.2 and up get a little closer to that, but Python is really a procedural language with a very nice but very optional set of OO features. (Internally, the Python and Perl OO implementaions are very similar, even if Perl's hideous object syntax does a good job of hiding it.) This is a nice pragmatic approach, akin to what Objective C does.
If OO purity is one of those things that appeals to you, Ruby or Smalltalk might be fun toys.
And regarding your example code, the same can be done trivially in C++ with the added significant bonus of strong static typing:Three lines of Python, three lines of C++ (barring the typedef, which is only there to make the rest of it easier to read).
You've been fed a batch of bad Kool-Aid. Fortunately, it's not too late to come around.
It's what LISP brings to the table above and beyond being a programming language (as most programmers think of the term) which makes it so astonishingly wonderful.
Build Your Own Syntax. See why I say it's difficult? You haven't ANYTHING done for you in advance.
Presto. Right there's a merge done in eight lines of code. It's generalized to the point where it works for anything, provided you give it an appropriate comparison function. And note--I didn't need anything big and fancy to do it. No imports or includes, no useless structural scaffolding...
LISP provides you with all the tools you'd expect of a modern programming language. The beauty of LISP is that you can do a hell of a lot of things in very small amounts of code without needing anything special. Ever seen someone write a PROLOG interpreter in 150 lines of LISP?
But how do to learn to create those domain-specific languages?
You start by doing, of course. You start by solving just one little part of the problem set, and you'll get about fifty lines in and you'll realize, "wouldn't it be nice if the language allowed me to do $foo?" Then you go off and make the language do $foo. Lather, rinse, repeat, until you've got thousands of lines of code creating a new special-purpose language to solve problems in a given problem domain, and five lines of code that actually solve your problem.
It is so far away from conventional academic lectures
Ever taken a Computational Theory course? LISP and LISP-like languages are used very heavily in Computational Theory courses precisely because they're so intimately tied to the lambda calculus, which is a formal model of computation.
And at MIT, introductory CompSci students are taught in Scheme, so you can't even say it's far removed from undergraduate lectures, either.
that one needs to forget almost everything to start thinking that way!
Yep. You do need to forget everything in order to start thinking that way. That's why it's called progress. Once you grok LISP and the lambda calculus, you not only see how to recreate all the old ways of doing business--you see how the old ways of doing business actually work, because now you have a formal model of computation to fall back upon.
And I'm not convinced that that syntaxlessness is indispensable
Syntax is necessary because otherwise you're left with a jumbled mess--sound and fury signifying nothing. If I pound out random letters at my keyboard I can say that it's the complete works of Shakespeare ("yes, dsfw98eradjct9e! is actually `to be or not to be'"), but that doesn't mean anyone can comprehend them.
To that extent, LISP has a very strong syntax. Don't mistake the simplicity of LISP's syntax for a simplistic syntax. LISP's syntax is extremely regular and extremely simple--far more than any other language I've come across.
If the matter is problem solving, just learn problem solving, not Lisp language.
LISP is a language meant specifically to solve problems. Where's your problem with it?
I would prefer to have some syntactic sugar which does the code more readable than those ((if()(and no then)(nor else keywords))s)
Get a good IDE and spend a few hour
Perl is a better shellscript than shellscript. Systems administrators who are tired of dealing with the horrors of shell script like perl. Perl is also great for text manipulation. One can write insanely powerful and terse code for this in perl (like sed on steroids). People who yank a lot of text around (web developers, sys admins) often like perl for this reason.
Python is more of a "programmers language". You can't write insanely terse code in python, because the python philosophy dictates that the code should be comprehensible. You can still write concise code, but you can't "code in grunts" like you can in perl or bourne shell script.
Python has a cleaner OO model (not bolted on). It's easier to extend (via C or C++). It also makes a good high level wrapper for C or C++ libraries. It is infinitely better than perl for coding GUIs.
That's about all I can think of for now.
First off, as others have pointed out, you don't need to introduce a new class to do this kind of thing - C++ has vectors and pairs built in, and tuples will probably be in the next version of the standard.
However, you're right about the 'easy to instantiate' part, but I don't think static typing is really the problem. The problem with types in C++ is that you have to explicitly mention them, when a lot of the time the compiler could figure them out itself. In your example, you could do:
std::vector<std::pair<std::string, std::string> > entries = get_address_entries();
The type declaration isn't really necessary - the compiler knows that get_address_entries() returns a vector of pairs of strings, so could give the variable it's proper type. There's been some discussion about introducing type-inference into the language, so you could say:
auto entries = get_address_entries();
Which would make this kind of thing as easy to use as Python, while keeping the advantages of static typing in tracking down errors.
Ok I'll bite =)
ANYTHING that you can do in Lisp/Ocaml (and other functional languages), you can do in Python. Go read a bit. Python does not force you into any style. You're free to use whatver you want.