Python bytecode compatibility between interpreter versions

Jon Perez jbperez808 at yahoo.com
Sun Mar 21 10:53:06 EST 2004


Skip Montanaro wrote:

> The fundamental difference between Java and Python in this regard is that
> the JVM must absolutely be part of the defined API since it is delivered
> separate from the compiler.  

Absolutely untrue.  The JVM is part of the Java /spec/, but has nothing to do
with the /API/ (e.g. Java 2 Standard Edition) that application programmers use.

> Whoever does this stuff probably has to go to great lengths to preserve 
 > compatibility.  This is not the case for the Python VM, since a new version
 > is delivered with each distribution.

I don't get what you're trying to say here.  The JVM has changed very little
(or not at all) over the different Java versions.  Neither the incremental
feature-additions to the Java compiler nor modifications to the Java platform
APIs require any great effort to 'maintain compatibility' between them and the
JVM.  Even fairly major additions like generics (i.e. Pizza compiler) do not
sound like they require ripping out great chunks of guts and replacing them with
something totally new.

If anything though, what you're saying might apply more to Jython.  New Python
language features tend to be more radical / come faster than new Java features
but the Jython authors will have to implement these on a JVM that cannot morph
to accomodate such new features.  Still, Jython's continued development proves
that it is possible implement Python's features on a fixed underlying VM.

The only reason I can think of for wanting CPython's VM to remain undocumented /
not-nailed-down is because we want to make it easier / give more freedom to the
language designers to implement the plumbing for new Python features.



More information about the Python-list mailing list