Slashdot Mirror


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."

61 of 226 comments (clear)

  1. Python by Anonymous Coward · · Score: 2, Interesting

    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?

    1. Re:Python by maharg · · Score: 4, Informative

      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.
    2. Re:Python by holovaty · · Score: 5, Informative

      I highly recommend Dive into Python, a free online book that's targeted at experienced programmers.

  2. Start here by niom · · Score: 5, Informative

    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".
  3. Can anyone by Timesprout · · Score: 3, Interesting

    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
    1. Re:Can anyone by pioneer · · Score: 3, Interesting

      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.

      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.

      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 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).

    2. Re:Can anyone by Telex4 · · Score: 4, Interesting

      Compared to the other "scripting" languages I know (Perl, Bash, PHP, so fairly limited), Python has a few major differences:

      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...)

    3. Re:Can anyone by fredrikj · · Score: 4, Informative

      You might find Eric S. Raymond's take on the question quite informative.

    4. Re:Can anyone by merlin262 · · Score: 5, 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.

    5. Re:Can anyone by einstein · · Score: 4, Funny

      Lisp programmers scare me. Someone mentions a feature that lisp has had for a few years, and invariable some lisp guy comments on how it's the future! switch now! Look at all the babes I attract with my Lisp skillz!

    6. Re:Can anyone by JanneM · · Score: 5, Interesting

      Depends on what you mean.

      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.

      --
      Trust the Computer. The Computer is your friend.
    7. Re:Can anyone by pioneer · · Score: 2, Informative

      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.

    8. Re:Can anyone by ultrabot · · Score: 4, Interesting

      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.

      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 :-)

      --
      Save your wrists today - switch to Dvorak
    9. Re:Can anyone by tordia · · Score: 2, Informative
      Any language that is *only* objected oriented is forcing you to look at everything as nails.

      From the Learning Python book (see sec. 1.1.1.1):

      Of equal significance, OOP is an option in Python; you can go far without having to become an object guru all at once.

      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.

    10. Re:Can anyone by Dan+Ost · · Score: 2, Informative

      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...
    11. Re:Can anyone by Malcontent · · Score: 3, Insightful

      By the same token it does bother me that people are constantly re-inventing things that have been around for a long time.

      I look around and it seems to me like most "new" things in CS have been around for 20 years. Why is everybody so intent on rewriting smalltalk and lisp? Does it seem strange to you that every language eventually starts looking like smalltalk and lisp?

      --

      War is necrophilia.

    12. Re:Can anyone by smallpaul · · Score: 2, 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.

    13. Re:Can anyone by be-fan · · Score: 3, Interesting

      While Lisp programmers can be scary* there is some element of truth to it. I was trying to extend SCONS (a build system) to make it easier to use while building my OS kernel. I needed to have lots of conditionals, to handle varying platforms and build situations. Now that I look back on it, there are a lot of Lisp ideas in there. Specifically, if code is data, then data should be code, right? So I ditched my original idea of using an XML file format, and decided to use regular python scripts as the config files. It worked like a charm, and the resulting build system was flexible enough that when I applied it to a later project for work, I only had to write a couple of dozen lines of build scripts for a complicated project that needed to build on Linux, Windows, be configurable to use various CORBA ORBs, and have switchable drivers at compile time.

      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.

      --
      A deep unwavering belief is a sure sign you're missing something...
    14. Re:Can anyone by Meowing · · Score: 3, Informative
      Python is totally object orientated

      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.

    15. Re:Can anyone by commodoresloat · · Score: 3, Funny
      Why is everybody so intent on rewriting smalltalk and lisp?

      Because they get embarrassed trying to make smalltalk with a lisp.

    16. Re:Can anyone by ZvlvLord · · Score: 2, Informative

      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.

  4. The MAJOR advantage is simplicity by TuringTest · · Score: 4, Informative
    The second name of Python is "Executable Pseudocode".

    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.
    1. Re:The MAJOR advantage is simplicity by Malcontent · · Score: 2, Funny

      You should say "easier to read then perl" because I don't think it's easier to read then ruby or php or even java. But then again just about anything is easier to read then perl. Perl code looks like it's cursing at you.

      --

      War is necrophilia.

    2. Re:The MAJOR advantage is simplicity by Brian+Quinlan · · Score: 2, Insightful
      You should say "easier to read then perl" because I don't think it's easier to read then ruby or php or even java

      I think that Python is a lot easier to read than Ruby or Java. Ruby allows a lot of the same punctuation-based idioms that make Perl so difficult to read and Java is too verbose to be easy to read. Consider the Java version of hello world:
      class HelloWorldApp {
      public static void main(String[] args) {
      System.out.println("Hello World!");
      }
      }

      Cheers,
      Brian
  5. From the interview by Anonymous Coward · · Score: 3, Funny

    Interviewer: Why did you make whitespace significant in Python?
    Guido: I smoked a lot of crack that day.

  6. Python vs. the others by henriksh · · Score: 3, Interesting

    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.

    1. Re:Python vs. the others by henriksh · · Score: 3, Interesting
      Could you please explain how PERL and Python serve different purposes?
      For one thing, Perl is much more used by UNIX (*BSD and GNU/Linux included) system administrators. Some people think Perl is more in the UNIX spirit than Python.

      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.

    2. Re:Python vs. the others by glenstar · · Score: 2, Funny
      Some people think Perl is more in the UNIX spirit than Python.

      Difficult and surly? ;-)

    3. Re:Python vs. the others by elflord · · Score: 3, Informative
      Could you please explain how PERL and Python serve different purposes?

      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.

  7. Is Python still lacking a macro system? by oodl · · Score: 3, Interesting

    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.

    1. Re:Is Python still lacking a macro system? by fredrikj · · Score: 4, Interesting

      Any real geek knows that a language that isn't self-extensible through its macro system (ala Lisp, Scheme, Dylan) is just plane lame. :-)

      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 :P

      I assume that Python is still not efficiently compilable either, right?

      Not quite. There is however a dynamic compiler called Psyco, 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.

    2. Re:Is Python still lacking a macro system? by oodl · · Score: 2, Informative

      > 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.

    3. Re:Is Python still lacking a macro system? by Ian+Bicking · · Score: 4, Insightful
      No, Python doesn't and won't have a macro system. The Lisp features like lambda and map are kind of in disrepute, at least from Guido's perspective -- see comp.lang.python for many opinions on the matter. Since Guido is Benevolent Dictator For Life, his opinion holds a great deal of sway. (BTW, map has been replaced with list comprehension, taken from Haskell, so it's not like functional programming as a whole is being rejected)

      Macros would indeed be more difficult to implement in Python, because data and code are not as interchangable as in Lisp (e.g., (car 1 2) being code, '(car 1 2) being data). Macro-like manipulations of Python code would be rather difficult. But there has been discussions about ways of achieving the same flexibility without quite so much generality.

      In a related example, some people feel that code blocks, ala Ruby or Smalltalk, are the right way to do control structures. Indeed they are very general. Python instead has developed notions of iteration, generation, and the use of first-class functions, and together they are all quite general as well -- you can do what you need to do. While more eclectic than anonymous functions/lambdas/closures, they are arguably more transparent -- you don't know what a function might do with a code block, and it can greatly effect surrounding code.

      So it is with macros -- they are extremely general, and can do unexpected and magic things, (which is not in fitting with core Python principals). As Python grows alternatives, more things need to be built into the languages, but the result is a set of predictable and well-known idioms. Python is a full language, not the basis for other languages, as Lisp can become.

      As far as performance, there are a number of things like Psyco, Pyrex, Numeric, and Weave/SciPy, which can handle performance problems (noting that in most application performance is not a problem). The result is again somewhat eclectic, but pragmatic. There's a wide variety of ways to optimize a Python program, many of which are just normal programming optimization (caching, making a process persistent, lazy loading, etc), as well as Python modules written in C or other compiled languages (potentially aided by things like SWIG, Pyrex, or ctypes)

  8. Favorite quote by henriksh · · Score: 2, Interesting
    Favorite quote from the interview:
    ORN: I sometimes think it's a good job nobody has patented breathing; otherwise we'd all owe them money.

    GvR: I guess there was prior art among the reptiles [smiles].
    Heh.
  9. Python is great. by metatruk · · Score: 4, Informative

    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.

  10. Why I like Python by Anonymous Coward · · Score: 2, Insightful
    I like Python because:

    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...

  11. My experiences by Gorny · · Score: 3, Interesting

    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"
  12. This is mine by TuringTest · · Score: 2, Interesting

    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.
  13. Re:Python on the Zaurus by uberslack · · Score: 2, Informative

    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.
  14. Re:Python - Python in a nutshell by hashmap · · 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

  15. Why python rules by joib · · Score: 2, Informative

    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).

  16. Re:New processors by Filip+Maurits · · Score: 2, Informative

    Python already works on 64-bit systems.

  17. Java is not interpreted by Decaff · · Score: 2, Informative

    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.

    1. Re:Java is not interpreted by Anonymous Coward · · Score: 2, Insightful

      >> Saying that perl/python and other scripting languages beat Java in terms of speed is simply typical Slashdot anti-java FUD.

      Actually, it's not FUD.

      For string processing, database access, and pretty much...well...everything, Perl *smokes* Java. Python is slower than Perl, but Guido acknowledges that.

      Also, though one can buy into the Java Marketing Machine and proclaim that there is indeed a "Virtual Machine" and "Java is not interpreted", in fact, very few languages are actually "interpreted" in the line by line execution sense of GW Basic these days. Perl builds a parse tree and then executes this parse tree. Java bytecode is produced from source, but this bytecode, too, must be executed as data, not as a native instruction. All of this is relatively meaningless; arguing that Java's "virtual machine" is not an interpreter does not say anything for the language, and I'm really disappointed that you would make random speed claims without code to back that up.

      Now let's talk about memory footprint and how small you can make Hello World + the interpreter be in Java. I can get it disk space to 500k (with PAR) without even trying. The python folks can do similar with py2exe.

      Also, do you happen to have source code for your language? Can you contribute new modules to be accepted by Sun into the standard distribution?

  18. Re:Unfortunately... Re:Don't fully agree. by __past__ · · Score: 3, Insightful
    so, the whole point is that Lisp is not a programming language but a kind of language definition language? Just a raw parse tree, and Build Your Own Syntax. See why I say it's difficult? You haven't ANYTHING done for you in advance.
    Oh, come on. Common Lisp has about 1000 defined symbols (i.e. variables, functions, macros, classes ...). It includes an extremely powerful exception system, highly flexible OOP, and all the mundane stuff like lots of standard datatypes, control structures, IO, pretty printing etc. People frequently bash it because it's too big.

    You don't have to do any kind of language design when you do Lisp programming. You can get a long way with just using plain function definitions. Yet you can easily define new syntaxes, control structures and stuff.

    never got to understand why Lisp programmers think of the macro system as the primary and more exclusive power of the language, now I start to see it. But how do to learn to create those domain-specific languages? It is so far away from conventional academic lectures, that one needs to forget almost everything to start thinking that way!
    Back when I was the proud owner of a Commodore C 128, I used to think similar things about useless stuff like GOSUB. Why can't we just stay with the more familiar GOTO that everyone understands?

    Get over it. Learning new tools is usefull, but it's work. Get a good book on Lisp macros, and dive in.

    And I'm not convinced that that syntaxlessness is indispensable. [...] I would prefer to have some syntactic sugar
    You are not alone. And, given that you can actually define a new syntax, many people tried to come up with alternatives to raw s-expressions. And indeed succeeded. However, none of these alternatives ever got too popular (the most successfull attempt might by the Dylan language, which started with s-expressions, but dropped them). People could have used alternative syntaxes, but the vast majority chose not to.
  19. I second that by stewby18 · · Score: 2, Informative

    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.

  20. Please change "Von" to "Van" by brrrrrrt · · Score: 2, Informative

    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..

  21. My favorite quote from the article by Doppler00 · · Score: 2, Funny

    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...
  22. Re:Python - Python in a nutshell by phthisic · · Score: 2, Informative
    I've been coding for several years now, both professionally and as a hobby, in maybe a dozen different languages (most of those as a hobby). I love Python. I'm addicted to it. And I love Nutshell books (I have 13 or more), but I don't care that much for Python in a Nutshell. Nutshell books are best when they are a high-density first read and a great reference afterwards. This one, however, has too much of a narrative thread to be a great reference and yet at the same time that narrative is not well woven -- the book is too choppy to be easily read straight trough. I would love a book written like VBScript in a Nutshell but about Python.

    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:
    Python 2.2.2 (#1, Feb 24 2003, 19:13:11)
    [GCC 3.2.2 20030222 (Red Hat Linux 3.2.2-4)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import Tkinter as tk
    >>> root = tk.Tk()
    >>> btn = tk.Button(root)
    >>> btn.pack()
    >>> btn.configure(text='Exit')
    >>> import sys
    >>> btn.configure(command=sys.exit)
    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.
    >>> for a in dir(btn):
    ... print a
    ...
    _Misc__winfo_getint
    _Misc__winfo_parseitem
    __doc__
    [etc.]
    winfo_width
    winfo_x
    winfo_y
    >>>
    >>> for key in btn.keys():
    ... print key
    ...
    activebackground
    activeforeground
    anchor
    [etc.]
    underline
    width
    wraplength
    >>>
    I would greatly appreciate it if someone could point me to a quality Tkinter reference.
  23. PHP is not easy to read, in most cases by supton · · Score: 3, Insightful

    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.

  24. PHP: Capable != Appropriate by supton · · Score: 2, Insightful

    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.

  25. Re:Fool! by jc42 · · Score: 2, Funny

    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.
  26. Inaccuracy about GPL by solferino · · Score: 2, Informative

    van Rossum :

    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.

    parent poster (Slothrup) :

    WTF? The GPL didn't exist in 1991? I guess I was hallucinating when I was using GNU Emacs and GCC in the 80s.

    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.

  27. Re:Dump the significant whitespace! by Internet+Dog · · Score: 2, Insightful

    You have obviously not tried using Python. That's your loss. I have yet to hear of a whitespace bigot who tries Python for a few weeks who doesn't change their position regarding the use of whitespace as a block delimiting mechanism. The degree of the conversion ranges from sheepishly admitting that it works very well, to becoming raving supporters of Python because the feature works so well.

    Proper indentation of a program is considered good style in all computer languages, including Perl. It is simply good programming practice to indent consistantly within a program. Python simply requires that good style be used in a program, rather than leave it as an option. This seems to irritate many narrow-minded, lazy, and sloppy programmers who think curly braces are the only proper way to denote blocks of code.

  28. C++ and tuples by rjh · · Score: 2, Informative
    If you haven't already checked out Boost, now would be the time. Boost provides tuples in C++.

    And regarding your example code, the same can be done trivially in C++ with the added significant bonus of strong static typing:
    typedef std::vector<std::pair<std::string, std::string> > StringPairVec;

    StringPairVec tuples = AddressBook.getEntries();
    for (StringPairVec::const_iterator i = tuples.begin() ; i != tuples.end() ; i++)
    std::cout << i->first << " lives in " << i->second << std::endl;
    Three lines of Python, three lines of C++ (barring the typedef, which is only there to make the rest of it easier to read).
    1. Re:C++ and tuples by ultrabot · · Score: 2, Interesting

      And regarding your example code, the same can be done trivially in C++ with the added significant bonus of strong static typing:

      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.

      --
      Save your wrists today - switch to Dvorak
    2. Re:C++ and tuples by chgros · · Score: 2, Informative

      i++
      You should always use the prefix increment ++i when using STL iterators (although in the case of vector they might just be typedefs for pointers).
      The reason is that since the postincrement must return the previous value, the iterator has to be copied.

  29. LISP misconceptions by rjh · · Score: 2, Informative
    the whole point is that Lisp is not a programming language but a kind of language definition language?

    You've been fed a batch of bad Kool-Aid. Fortunately, it's not too late to come around. :) LISP is, without a doubt, a full-featured programming language. It supports everything Java does, for instance; objects, iteration, exceptions, variables, recursion... the list goes on and on.

    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.

    (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)))))

    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

  30. Re:Dump the significant whitespace! by elflord · · Score: 2, Interesting
    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?

    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.

  31. Explicit typing by Homburg · · Score: 2, Informative

    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.

  32. Great for the occasional programmer by Nice2Cats · · Score: 3, Interesting
    The good things about Python that the other posters mentioned are true, but there is one thing that I really love about the language: It not only fits into your brain, it also stays there, even if months pass between programming sessions.

    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?

    if 'chocolate' in mystring:
    ....print 'I love it!'

    (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.