Python compared toJava

Geoff Gerrietts geoff at gerrietts.net
Thu Apr 10 13:24:28 EDT 2003


Quoting Blaktyger (blaktyger at hotmail.com):
> Hi!
> 
> I recently read that the Python interpreter is like the Java Virtual Machine.
> Is that true?

It's hard to tell exactly what you mean by this, but since you seem to
have received an unusually high proportion of flip or catty responses,
I'll try to reply.

A Java program runs inside the context of the JVM. A Python program
runs inside the context of the Python interpreter. In this way they
are similar: the actual process observed in the operating system's
process table will be the JVM or interpreter, not the program itself.

Similarly, the JVM provides a standard interface for Java programs.
The idea is that the JVM will be standard across multiple different
platforms. The Python interpreter tries to offer the same kind of
portability. Neither is completely successful, but a careful developer
can achieve portability on either.

In other ways, these two environments are different. The JVM will not
compile code into bytecode for you; you need a Java compiler for that.
The Python interpreter will compile code into bytecode as required.
The JVM runs Java bytecode; the Python interpreter runs Python code.
Etcetera.

Answering your question really requires a better understanding of what
you want to know: in what way have you heard that these two are alike?
You should probably interpret the rash of snide replies to mean just
that: we don't really know what you're asking, but we'd answer you if
we did.

--G.

-- 
Geoff Gerrietts             "Me and my homies, we tag O.D.."
<geoff at gerrietts net>        --Unknown grafitti artist at a party





More information about the Python-list mailing list