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."
I want to learn python, where should I start? I have looked at it breifly before, but now I actually have time to learn it. Any good pointers?
For those with OpenZaurus, install the python packages and learn it between meetings/classes/etc.
You can't judge a book by the way it wears its hair.
Interesting that smarts still counts for something, and that they're not just employing talented developers just for the producs they have created. Hope the trend continues.
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".
explain what the major advantages of using Python are. I have only ever looked at it very briefly and even more briefly at Jython. From this very limited experience I cant really think of a compelling reason to use Python over some of the more mainstream languages, other than perhaps as a scripting type glue.
Do not try to read the dupe, thats impossible. Instead, only try to realize the truth
What truth?
There is no dupe
Guido van Rossum Speaks
by Steve Holden
08/14/2003
Guido van Rossum is the well-known creator of the Python programming language. During his address at OSCON 2003's States of the Unions event, he announced that he'd soon be leaving PythonLabs to work for a California startup. Guido graciously agreed to an interview with Steve Holden on the move, recent developments, and Python in general.
O'Reilly Network: Can you explain why you're leaving PythonLabs and where you're going?
Guido van Rossum: Moving to California has always been on my list of things to try eventually. When Dan Farmer approached me in February to join his new software company, where he anticipated there would be lots of need for language design skills, my initial thoughts were that such a move would be too disruptive to my family.
Dan kept pushing, and when he had his venture capital lined up he asked me out to California for an interview. My plan for that interview was to find out what was wrong with the company or the business plan and to use that to maintain my original decision. But, try as I might, I couldn't find anything wrong!
As the weekend progressed I got more enthusiastic, both about the project and about working with Dan.
ORN: So it wasn't so much an offer you couldn't refuse, rather an inability to find anything to justify a refusal?
GvR: The offer was a good one, and I certainly couldn't complain, but mostly I was surprised at my own enthusiasm for this new project.
ORN: What will your relationship with be with PythonLabs and with the Python Software Foundation in the future?
GvR: In terms of personal relationships nothing much will change. I really like the PythonLabs guys, and most of us have worked together for eight years since the CNRI days. It was difficult to move without being able to make them all an offer, but for various reasons none of them would have wanted to make the move.
I will remain the head of the PSF. Board meetings will be a little different as I'll be using IRC rather than being present in person. As you proved during the PyCon DC 2003 planning process, that's fine as long as people can make the time for a fat cock up their ass, and I'll certainly make the time for PSF board meetings.
ORN: This is the third time in as many years you've changed employers?
GvR: That's right.
ORN: Does this indicate some kind of instability in the employment market?
GvR: I think if the economy had been better I wouldn't have left Zope, and Zope might have been more fun. Really, though, it's more of a reflection on the opportunities that have come to me personally.
ORN: Serious Python users might be concerned about your continued involvement in the development of the language. What will the move mean for the future of Python?
GvR: First, it's written into my contract that the development work I do on Python will not belong to Elemental Security. That will continue to be owned by he Python Software Foundation.
Also I will have time carved out in my regular work week to work on Python. So I'm pretty hopeful that once the dust of the move has settled, say in mid-August or so, I will have enough time for Python.
It's not my dream Python job, which would basically be to be paid to work with a team about the size of PythonLabs to work on the development of Python full-time. That's not a realistic possibility at the moment.
ORN: What will you miss most about Virginia?
GvR: The friends I've made there. I've lived there for eight years, and during that time I've made some really great friends.
ORN: What East coast ties do you intend to retain?
All of them. I plan to stay in touch with all of those friends, and they're all going to be welcome to stay in our house in California as long as there's space--we haven't found a place to live yet, and the Bay Area's even more expensive than the DC Metro area!
ORN: You are a family man, with a life besides IT. How much o
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.
Interviewer: Why did you make whitespace significant in Python?
Guido: I smoked a lot of crack that day.
I think Python has a very bright future. For many purposes, it obsoletes Java. Java is more widespread than Python now, but it's proprietary and suffers from a historically slow GUI.
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.
I, for one, welcome our new Python overlords and will gadly submit to their constrictions.
Any real geek knows that a language that isn't self-extensible through its macro system (ala Lisp, Scheme, Dylan) is just plane lame. :-)
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.
For off, I really enjoy using Python. I find that it's really powerful, but still easy enough to use for those quick coding tasks that I need to write as a Solaris administrator.
I'm wondering this, however -- how will Python be affected in the 64-bit processor realm? Will it need to be modified significantly?
Reply or e-mail; don't vaguely moderate. Ex-O'Reilly/MIT employee, now a full-time Google employee.
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.
1) Indentation instead of bracing. Yes, I know some people hate it but for me it makes the structure so clear.
2) Object orientation. I did OO with C++. I actually understood it with Python.
3) The smoothest ever integration to low level languages like C. Gotta love it.
4) Easy to learn. Write ab initio code with C/Fortran and never-programmed-before people interface it with Python. Then, grind out those MSc and PhD theses...
Dylan is a language very similar to Scheme, but with an infix syntax and a module system.
:: ) => sorted-data :: ;
:-)
Here's some sample code:
define method quicksort (data
if (empty?(data) | empty?(tail(data)))
data;
else
collect(head(data), tail(data), #(), #());
end if;
end method quicksort;
I know Paul Graham is not a fan of Dylan because Dylan's infix syntax has complicated the macro system. But nonetheless, Dylan still has a powerful macro system.
Also in Dylan, the compiler is not part of the run-time, as it is in Lisp, which makes it not as powerful as Lisp in that sense.
But still the Fourth Annual ICFP Programming Contest judges proclaimed that Dylan is a fine programming tool for many applications.
Very interesting interview. I've had many conversations with experienced programmers and with people who'd barely could program a Hello World in Python. After discussions we allways came out with Python to be the best language to learn to the newbies. It's nice, clean, dynamic-typed, which I find an important thing for someone new to programming, cause it lets you focus on the WHOLE thing and not on minor details (eg. details).
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.
Alan Perlis once said: "A language that doesn't affect the way you think about programming, is not worth knowing"
Well, for one Lisp's syntax is FAR easier than Oz's. Oz borrows a lot of syntax from ML which possibly has one of the most barroque syntax I've ever seen. Next, macros are extremely nice, more people know Lisp and Scheme than people know Oz, etc. You are right that there is no good free cross-platform implementation of Common Lisp. Scheme has PLT Scheme which runs on all three major platforms (*nix, Windows, Mac). Paul Graham has an upcoming dialect of Lisp coming called Arc, which I'm sure he'll port to these three platforms. Oh, and Emacs+ilisp is by far one of the best development environment I've used (maybe only second to Squeak)
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
ORN: This resonates with your long-held interests in "computer programming for everyone". Don't you think that perhaps "everyone" is too broad, and that there aren't at least some people who will never be capable programming a computer?
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.
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
[Lisp] has a really steep learning curve, and there are no good free (as in software) development environments, as far as I know. (IANALisp Expert, though). Just you, Emacs and the Lisp interpreter.
Lisp is as powerful as mathematics, but there is more to a language than its semantics. It has to be accessible, too.
First off, Lisp isn't hard. It's like othelllo. Takes a day to learn and a lifetime to master. (gag)
My brief look at Oz seems to illustrate some similarities, but I'd have to check it out more to understand. Both have a core language set that everything else is reduced to. In lisp these are cons, car, cdr, cond, quote, apply, eval.
I'll take a look at Oz but what makes Lisp very powerful is that it has no syntax. The text is literally the parse tree which means that macros are very easy to define and use. The entire idea of programming using Lisp is to develop a language on top of Lisp. If you are writing an image editor you define an embedded language in Lisp for image manipulation. An because things can be compiled at runtime and macros can hide computation at compile time you can get good performance as well.
There is also a misconception that a language needs to explicit in what is efficient and inefficient. What is misunderstood is that it is very often not obvious where the bottlenecks are. The way to make a Lisp program fast is the same way you make a C program fast. 1) Profile 2) Find hot spots 3) Optimize 4) Rinse and repeat.
Also, concerning free development environment check out Dr. Scheme which is a nice UI and comes with a bunch of packages. I was working on some encryption problems and had a graphical histogram implemented in about 2 minutes. Try doing that in Java.
Lisp isn't designed for the average programmer. The best programmers use Lisp (if they are allowed to by their bosses) because it is the most powerful.
Is that you?
vs sex with a mare ?
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
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).
;-) And I would like to like Lispness, but just don't get it.
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
You could implement that as a top-level function or even as a class method, and it would just work. And it would be easy to understand and program (something which, I believe, Lisp macros aren't).
;-)
The only difference I think it would have is that it would run at execution time, not compile time. But I'm sure that a not too far away future version of Python will do that...
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
Python isn't "totally" object oriented.
> 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.
then, no mathematical mind is healthy! 8-) You did well in change, if you have a sequential mind.
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
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.
I guess one difference is that it has a long history, since it was first distributed in 1991. In those days nobody talked about "open source", and Richard Stallman [founder of the Free Software Foundation] wasn't very well known and the GNU General Public License didn't exist.
WTF? The GPL didn't exist in 1991? I guess I was hallucinating when I was using GNU Emacs and GCC in the 80s.
The difference between theory and practice is that, in theory, there is no difference between theory and practice.
ATTENTION Slashdotters.
The poster is named "Arthur T Murray" and is a well known newsloon
and crackpot extraordinaire!
Please don't feed the shills.
Compared to C code I have found python to be 10x faster to put together functioning programs. Whenever I have a task were cpu cycles are not critical, I do it in python.
One insight I had the other day, is that even though python is a yonger, less popular language than C/C++, you can do anything (algorythmically) in python that you can in C/C++ with the standard libraries, plus a whole lot more. That implies to me that python is more expressive and productive, because the people writing the libraries have packed in so much functionality.
C is for execution speed. Python is for development speed.
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.
Oz borrows a lot of syntax from ML which possibly has one of the most barroque syntax I've ever seen.
That's odd because I find ML's sytax to be very sensible and simple (though I've only used OCaml and not any of the other ML dialects) and I find Lisp's unreadable. Many Lisp proponents like to say Lisp's is the one true syntax, but I don't see how that could be true when there must be a large subjective component to why one person prefers one syntax over another.
One of the problems I had when I tried to learn Lisp was that it needs special editor support. This meant, as far as I could tell, I had to learn emacs. I'm not interested in learning emacs. I prefer Windows style editors; their use is burned into my "finger memory" -- I'm used to them and am efficient with them. I did try to learn emacs once, but I found it very complicated. At that time at least, emacs could only scroll half a screen at a time. This seemed to me to be rather unergonomic! There was an add-on available to add line-by-line scrolling, but to install it I needed to Read The very large F'ing Manual and learn Lisp! I don't think it can be said that Lisp's syntax is easy if in order to learn it, you have to learn some complicated tool on top of learning the language itself.
In any case, just looking at Lisp code on paper, I find it hard to read. I can see that everything being S-expressions is conceptually very elegant, but to me there are not enough cues there for my human brain to parse the text easily. No doubt I could learn to read Lisp code with practice, but the initial hurdles are too great for me to bother with it just now, especially when there are so many interesting languages out there. And I find all the Lisp zealotry offputting. (I'm not saying you are a zealot; I'm sure most Lisp users are level-headed, lovely people. But there seem to be a lot of Lisp zealots about.) I find it hard to take any kind of zealot's word about anything being the One True Thing because they always have huge blind spots.
Does anyone have any thoughts on extensible AI game programming using Python? Basically, I"m trying to create a user-programmable AI for a game (simple scripting that users can do, kind of like in many FPS games). I'm evaluating Python VS Lua (google to find info about Lua). I think Lua is best for my tasks but does anyone have any thoughts on Python?
In particular, I'm not too sure about the performance implications of Python for a real-time game. The game is a free open-source game so it's not a life and death situation but still...
Sivaram Velauthapillai
Sivaram Velauthapillai
Seeking the meaning of life... @slashdot of all places
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..
GvR: ...I do it myself by staying where I am and giving keynotes at conferences and making my personal life the subject of discussions on Slashdot. ...
ORN: Perhaps they should get lives of their own instead of discussing yours?
I think he's talking about us...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.
That's odd because I find ML's sytax to be very sensible and simple
ML is strongly typed which means its immediately useless. OOP can viewed as a relaxation from strong types (in C) to slightly dynamic types. You watch, eventually most languages will be dynamically typed).
One of the problems I had when I tried to learn Lisp was that it needs special editor support. This meant, as far as I could tell, I had to learn emacs.
First off, emacs is butter. Emacs is gorgoes. Emacs is so extensible and so efficient that its stupid. If you sat down and learned it for a week you would be twice as efficient than any windows editor. Emacs is built on lisp and for this reason all of emacs is extensible... everything!!! It's really amazing.
Concerning Lisp syntax, the thing about Lisp syntax is that its syntax is a parse tree where as most languages (none s-expression languages) require a token/parser stage to compile. Because you work on the sytax tree, macros are trivial to write because you are just performing modifications on the parse tree...
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.
what's up dude, I just got metamod for the guy who flamed you down; he's getting an unfair. peace, justice and the american way.
Down with significant whitespace! The problem is that you can't tell what a whitespace character is by looking at it. For example, is that a tab, or is it eight spaces? There is no way to tell! You can't type in a program printed on paper and be sure that you got the whitespace right. Often you can't even be sure that you will get the same whitespace if the program is distributed over the internet as text.
Until Python replaces significant whitespace with printable characters, it will always be a poor second to Perl in my book.
You can write "Hello, world!" in only 500k?
I'm impressed. In my youth, we did it using feeble tools like x86 assembler on MS-DOS, and it required a massive 25 bytes, more than half of them taken by the string in question.
I know about apples and oranges, but I can't help wondering if the way that half megabyte overhead is tossed around so casually doesn't account for why today's 3Ghz processor, 1GB RAM beasts still struggle to handle a mid-size word processor document...
If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
PHP suffers readability not in syntax, but in archetecure design. With global namespaces for module functions (say, for example, to FTP a file), you do not have the ability to trace the logic between source files and modules in someone else's code. In addition, PHP encourages the inlining of code in presentation, and most PHP code is not modular (some is) - but on top of that the most popular mechanism for code reuse is eval() and include(), which simply pop more crap into the global namespace without being explicit what they do.
All this impacts readability. Python does not have these problems becuase it encourages explicit namespaces for all objects/modules/packages/classes/etc. Python also enforces readabilty by simple (easy) use of whitespace (this is a good thing.
PHP is popular (as is M$ ASP) becuase it has a gentle slope for web designers to learn programming. I don't think this is a bad thing, but inlining code and presentation is really not the right way to be encouraging new folks to programming to code... PHP teaches programmers bad habits like excessive use of global namespaces, and generally is accomplished with poor editing style becuase it is inlined with HTML, which has different needs for editing/indentation/etc.
A more appropriate introduction for this audience to programming might be python and TAL (template attribute language - the core of Zope's Page Templates, and the only vendor-neutral industry standard, cross-language templating system beside XSLT). I'm not suggesting Zope is appropriate for everyone (though for big apps, it really is best), but perhaps mod_python + page templates would be a better alternative for lightweight web-based scripting than PHP.
PHP does not work well for team programming, and Python does. If you are developing applications in a vacuum, by yourself, this may not matter, but on a team where you need to have coders of many skill levels, business managers, and designers interact, you really need to divide logic from presentation, and use componentized code with explicit namespaces to enable that sort of interaction. Otherwise, it just more <?PHP include("./someunknownquantity.php"; ?> magic.
> 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.
But it's easy to jump through those hoops in Perl. Just use a module. Here is an example of how to do it using a module:
#!/usr/bin/perl
package Object1;
use strict;
use warnings;
# Easy OO in Perl, using the Class::Struct module
use Class::Struct;
struct(name => '$', id => '$');
my $obj1 = Object1->new;
$obj1->name("Bart Simpson"); $obj1->id(12345); $obj1->display;
sub display
{
my $self = shift;
print("My name is ", $self->name, ", my id is ", $self->id, "\n");
}
__END__
Cut-n-paste that in and try it out. Read the documentation for Class::Struct, Class::MakeMethods, and Class::MethodMaker with perldoc. It is easy and fun to write OO Perl, and it scales very well to big projects.
Perl gives you several ways to go object-oriented, including writing the everything yourself. But it's easier to use a module.
Well, of course you can do anything in perl. First you write a routine that emulates a Turing machine ...
Those who do study history are doomed to stand helplessly by while everyone else repeats it.
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.
ML is strongly typed which means its immediately useless. OOP can viewed as a relaxation from strong types (in C) to slightly dynamic types. You watch, eventually most languages will be dynamically typed).
You can't just dismiss static typing so easily. (I think "static" is a more accurate term than "strong" here.) Static vs dynamic typing is the subject of endless religious wars, and there is no clear winner yet. Each has its advantages and disadvantages. My personal preference is to lean towards static typing but with type inferencing (like in ML) where you don't have to declare types unless you want to. I have done a fair amount of programming in dynamically typed languages (in fact, I've just convinced my bosses that a new app we are writing should be written in Python instead of C++. Hooray!).
First off, emacs is butter. Emacs is gorgoes. Emacs is so extensible and so efficient that its stupid. If you sat down and learned it for a week you would be twice as efficient than any windows editor. Emacs is built on lisp and for this reason all of emacs is extensible... everything!!! It's really amazing.
What I like about Windows style editors (CUA style editors) is the simplicity; there's pretty much just the cursor keys, ctrl, shift, etc. I can drive that with the lower parts of my brain -- I don't have to consciously think about it, which is good when programming because then I can think about the problem at hand. I've heard that complicated editors like emacs and vi are good for touch typists. That sounds reasonable, but I'm not a touch typist. And whenever I need to do some fancy text processing, I just write a script.
Concerning Lisp syntax, the thing about Lisp syntax is that its syntax is a parse tree where as most languages (none s-expression languages) require a token/parser stage to compile. Because you work on the sytax tree, macros are trivial to write because you are just performing modifications on the parse tree...
Like I said, it's conceptually elegant. But I still don't think it's readable. Lisp macros are something I'll get around to looking at sometime. I think I'll wait till Arc comes out; hopefully much of Lisp's historical baggage will have been sloughed off and it will be more pleasant to learn.
The article is clean.
How many people are working on Arc? Will it be another Hurd type project?
I don't have much experience with other scripting languages, but I've found python to have a lot of very easy to use modules. I've found modules for polynomial fitting to data, large data sets, polygons operations - just out there when I looked for them. And many a useful library in C or C++ has been wrapped in Python. For example, I've written some CAD software (for very specific design operations we do where I work), and needed a way to merge polygons. I found a wrapper for the generalized polygon clipper (GPC) library, installed it and got it working in a few minutes. And because of the nice structure of the language, the modules are usually very easy to learn how to use.
It's not wasting time, I'm educating myself.
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
Yah, we should all be programming in machine code.
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.
You could probably implement inline regular expressions in C++ using expression templates, actually. Check out Spirit, which gives you inline BNF grammars in C++.
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 is. I've asked some amazingly stupid questions in my time, and they have been very gentle and kind.
Well, there are lisp and clos implementaion in Java ... just like there are Smaltalk implementatins in Java.
See: grunge.cs.tu-berlin.de/~tolk/vmlanguages.html
angel'o'sphere
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
You made an excellent post, but it misses the point, I think most LISP enthusiasts miss the point, because they simply do not realize that diffrent people THINK DIFFERENT!!
...
... not strong typed ... how should I know that cmp is a function? And how should *I* as a german realize that cmp is short hand for "compare"? How many native english speakers would think cmp stands for compute?
... for the non lispers: its a condition, similar to switch, or lets say a more structured if/else chain.
... if l2, where is looked at is null. ... C .... and other languages: how the heck am I supposed to memorize that the statement above (choose between d and e if you like) does perform a "return"?
... ....
/// what the heck is the 't# here anyway?
:-)
... there are no keywords at all .... not only a native english speaker can not guess what cdr and car means, no a non english speaker has not even a chance to look it up in a dictionary.
Your example
(define _merge (l1 l2 cmp)
(cond
((null l1) l2)
((null l2) l1)
((cmp (car l1) (car l2))
(cons (car l1) (_merge (cdr l1) l2 cmp)))
(t
(cons (car l2) (_merge l1 (cdr l2) cmp)))))
is excellent.
a) I'm at first german, and english I learned in school. So: That above is completely unreadable to me!
the only word in my english german dictionary where I can find a translation is null.
b) I understand most of the stuff anyway, as I learned some lisp basics.
c) So I analyze how someone might aproach that above:
(define _merge (l1 l2 cmp)
reading your further post, I realize cmp is a cmparision function.
As lisp is typeless
Same for cond
d) lets look at ((null l1) l2) now:
As someone who has learned just the absolute basics: I would asume null is something special similar to nil. NIL is the "empty list" or that what is null in C. So if the parameter l1 is "empty" the parameter l2 is returnd as result (as merging one list with an empty list yiels the non empty list unchanged).
e) same for ((null l2) l1):
Just a test for returning the OTHER list
So: I pledge you: I know pascal
f) now: ((cmp (car l1) (car l2))
As I have pointed out, cmp is a name for a function, whichis given as a parameter to the function _merge, jsut think about it like a pointer to a function inc, e.g. for the famous qsort function in the standard clib
I wonder what car means? Its not in my english/german dictionary
Well, this time I can only tell you what it does, I dont know the english word. It takes the first item of the list. So the statement compares with the cmp function the first element of l1 with the first element of l2.
g) lets look at (cons (car l1) (_merge (cdr l1) l2 cmp))) now:
three new things: cdr, again something not in my dict and cons another thing, not in my dict. And a recursive call to _merge again.
Bottom line, why is it not written like this:
(function _merge (l1 l2 compare:function)
(select_if
((empty l1) return l2)
((empty l2) return l1)
((compare (first_of l1) (first_of l2))
(new list (first_of l1) (_merge (first_of l1) l2 compare)))
(t
(new list (first_of l2) (_merge l1 (first_of l2) compare)))))
I have the strong feeling, that you do not really get my point
So I summarize: besides a way of using () which you need to get used to, there are theveral things hidden in 8 line sof lisp code:
i) recursion
ii) using of functions as arguments
iii) returning values without using "return" or anything similar as keyword
iv) basicly
v) totaly stupid nomenclature
Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
That's because you should rather use wxPython Try it and see...
Bah, all you've said is that functional programming is your only hammer.
http://www.talknerdy.org
That is also the nagging feeling I have had about extending applications with scripts. Not only are the scripts possibly violating the principle of least power, but you are handing over to your non-programmer users essentially a programming tool, no matter how sandboxed, hand-held, error-checked, and feature-restricted. At some level programming is programming with all the potential for bugs and bad design.