Repetition of work in Jython
steve at holdenweb.com
Thu Mar 25 19:10:00 CET 2010
Andrey Fedorov wrote:
> Hi all,
> So from what I understand, Jython translates Python code into JVM byte
> code. Does anyone know why this was chosen instead of translating Python
> bytecode to JVM bytecode directly? It seems that it would be a lot
> easier to get Jython up-to-speed if there could be some "shared
> components" between them and CPython, no?
I don't *know* why Jim Hugunin chose not to take that approach, but I
can easily imagine it would be because a mapping of the Python byte code
to the Java byte code would be much less efficient.
There are various approaches that one could take. The least efficient
would be to write a Python virtual machine in Java, thereby putting two
levels of interpretation into the execution paths.
I doubt it would be possible to get maximal JVM efficiency from code
cast into Python byte codes just because of the disparity between the
Steve Holden +1 571 484 6266 +1 800 494 3119
See PyCon Talks from Atlanta 2010 http://pycon.blip.tv/
Holden Web LLC http://www.holdenweb.com/
UPCOMING EVENTS: http://holdenweb.eventbrite.com/
More information about the Python-list