"just like Java" (was :Re: translating Python to Assembler)

Paul Boddie paul at boddie.org.uk
Fri Jan 25 09:45:45 EST 2008


On 25 Jan, 14:05, Bruno Desthuilliers <bruno.
42.desthuilli... at wtf.websiteburo.oops.com> wrote:
> Christian Heimes a écrit :
>
> > No, that is not correct. Python code is compiled to Python byte code and
> > execute inside a virtual machine just like Java or C#.
>
> I'm surprised you've not been flamed to death by now - last time I
> happened to write a pretty similar thing, I got a couple nut case
> accusing me of being a liar trying to spread FUD about Java vs Python
> respective VMs inner working, and even some usually sensible regulars
> jumping in to label my saying as "misleading"...

Well, it is important to make distinctions when people are wondering,
"If Python is 'so slow' and yet everyone tells me that the way it is
executed is 'just like Java', where does the difference in performance
come from?" Your responses seemed to focus more on waving that issue
away and leaving the whole topic in the realm of mystery. The result:
"Python is just like Java apparently, but it's slower and I don't know
why."

It's true in one sense that the statement "Python modules and scripts
are normally not even compiled" is incorrect, since modules at least
are compiled to another representation. However, if we grant the
author of that statement the benefit of his ambiguity, we can also
grant his statement a degree of tolerance by observing that modules
are not compiled to native code, which is the only experience some
people have with compilation and its results.

As was pointed out in that previous discussion, CPython instructions
are arguably less well-suited than Java instructions for translation
to CPU instructions. This alone should make people wonder about how
close CPython and the more prominent Java virtual machines are, as
well as the considerations which led the Java virtual machine
architecture to be designed in the way that it was.

Paul



More information about the Python-list mailing list