Why Python is like BASIC ... java "vs" python

Alex Martelli aleax at aleax.it
Mon Feb 18 03:45:52 EST 2002


Roy Smith wrote:
        ...
> whether a language is interactive or not.  With Python (or BASIC, or lisp,
> or shell, or ...) if you start it up and type something at it, it types
> something back at you and waits for you to type something else.  Perl, for
> example, doesn't work that way (at least not with the implementations I've

Use:
perl -d -e42

i.e., run the perl *debugger* (-d) on an arbitrary perl 'expression' (-e42)
and you get a 'DB<1> ' prompt that does let you do stuff.  Not quite as
neat as Python's interactive interpreter, but workable, in a typically
Perlish way (i.e., devious enough that you get to feel clever just for
figuring it out, while Python's typically so straightforward that when you
DO "figure out" something you often just feel almost dumb for not
having figured it out sooner -- maybe that kind of 'tiny egoboost' that
comes with Perl's approach is part of its psychological appeal:-).


> far still there.  In this respect, it's very much like Basic (or lisp).

I think Lisp was indeed the first language to come with the read/eval
loop approach -- however, if I recall correctly, it was also easier by
far in Lisp to "save all of my work so far" during an interactive session
(and for sure that was the typical way to work in other languages
based on interactive sessions, such as APL or Smalltalk).


Alex




More information about the Python-list mailing list