Why Python is like BASIC ... java "vs" python
Roy Smith
roy at panix.com
Sun Feb 17 13:06:02 EST 2002
Alex Martelli <aleax at aleax.it> wrote:
> It seems to me that this is a very good example of why "the distinction
> between interpreted and compiled *languages*", far from being "important",
> is utter, total, and absolute bunk.
The picture can be further complicated by the fact that some things that
you *think* are compiled are really being interpreted. The PowerPC-based
Macintoshes have a M68k compatability mode. As far as I understand it,
it's basicly an M68k virtual machine. So, you take a C program, compile it
into M68k machine code, and run it on a PPC. Is it compiled, or is it just
some virtual machine running bytecode? Kind of hard to say for sure.
The invention of things like dynamic libraries blurs the line between
"dynamic interpreted languages" and "static, compile-link-and-execute
languages" just a little bit more.
Vaxes used to do the same thing with pdp-11 binaries, but that was really
more of a hardware compatability mode than a virtual machine in the sense
we're talking about here. Of course, the vax was a microcoded machine, so
in a very real sense, you *were* running a software interpreter.
I think it's much more important, from the user perspective, to think about
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
seen). With Perl, if I want to "ask the computer", I can certainly start
up a perl interpreter and type stuff at it, but I need to hit control-D to
make it run it, then I'm back in the shell.
With Python, I can fire up he language, type a bunch of stuff at it, and
play around until I get what I need (or figure out what I wasn't sure of).
I do this many times a day when coding; it's easier than looking something
up! The fact that my python has readline support in it just makes it that
much easier, but the fundamental good thing is that when it evaluates what
I just typed at it, it leaves me in the system with everything I've done so
far still there. In this respect, it's very much like Basic (or lisp).
More information about the Python-list
mailing list