python vs. java, slight reprise (from sun, no less)
aleax at aleax.it
Sun Feb 9 16:33:23 CET 2003
holger krekel wrote:
>> connections and native interfaces. The key difference is that Python
>> is a scripting language. This means there is no compilation to byte
>> code so the Python runtime environment has to do two things in
>> addition to what the Java runtime environment does.
> Well, that disqualifies the survey quite a bit.
I took it as only a slightly-sloppy expression, which could be
rephrased as: "there is no NECESSARY compilation to byte code
[before the "Python runtime environment" executable or DLL gets
the code] and therefore said PyRE must also include code that is
able to do two things in addition to what the JRE does".
I.e.: it's weird that the PyRE is indeed smaller than the JRE,
because the PyRE, besides the PyVM, *must* include extra stuff,
the compiler, as well: such extra stuff must be around because
the main script is not saved to disk in bytecode form, AND also
because Python guarantees that the .pyc or .pyo files will be
regenerated if the .py source is also around, and never (also,
a .py source could be on a read-only part of the disk -- and
then, again, the PyRE must in general be able to parse that
source and generate the bytecode each time, on the fly).
You could presumably build a smaller specialised PyRE that
can only work on pregenerated bytecode, but the comparison
the memo is making is not with such a specialized PyRE, but
rather with the actual one in the standard distribution.
>> Given this data, it appears that the JRE can actually be simpler than
>> the Python RE since Java does at least some of this work at compile
> In fact, Python's VM is simpler.
I think you're right here, but also that (due to the slight
sloppiness I tried to clarify above) you might be missing the
point. The memo wants to raise alarm that the JRE is so big
DESPITE advantages in its specs (it has fewer things is must
be able to do, compared with the PyRE) which would appear to
be sufficient to allow it to be smaller.
>> from http://www.internalmemos.com/memos/memodetails.php?memo_id=1321
>> which is a great read for old pythonistas and javabashers like I am ;)
> I doubt it (without bothering to read it because of the above
> obvious errors), sorry.
I think you may want to forgive that sloppiness and read the
memo anyway; it IS interesting, despite that slight failing.
More information about the Python-list