Re: JavaVM compiler for Python?

Dan Connolly (connolly@www18.cern.ch)
18 Apr 1995 03:49:41 GMT

In article <3muu83$5oh@spud.Hyperion.COM> koreth@spud.Hyperion.COM (Steven Grimm) writes:

Heck, I'll take *any* kind of Python compiler.

Except the one that's built into the python interpeter, I take it :-).

The sluggish nature of the interpreter, especially the long startup time,

Are you aware that python .py files are compiled to bytecodes (.pyc)
files the first time they're run? After the first time, the startup
should be much faster.

Java, unlike python, perl, and many scheme implementations, doesn't
do bytecode compilation at runtime. The compiler isn't in the runtime
(necessarily.)

What are the obstacles to writing a Python compiler? As far as I can tell,
the big one is the "eval" statement, which basically forces you to include
a copy of the compiler in every executable.

Yes... this, and the fact that python has multiple inheritance, whereas
Java has single inheritance + interfaces. So method dispatch is different.

Java's namespace rules are different, but I don't know if that has
any runtime effect, i.e. I don't know if it has any impact on
a Python->JavaVM compiler.

Java also has a limitation of one public class per compilation unit.
The ways you can combine modules and classes in Python might be
more expressive than the JavaVM supports.

Not that I'm volunteering, mind you.

Nor am I :-(

Dan

--
Daniel W. Connolly        "We believe in the interconnectedness of all things"
Research Technical Staff, MIT/W3C
<connolly@w3.org>             http://www.w3.org/hypertext/WWW/People/Connolly