bytecode non-backcompatibility

"Martin v. Löwis" martin at v.loewis.de
Wed Apr 27 02:02:48 EDT 2005


Maurice LING wrote:
> Now I understand that Python bytecodes are only dealing with pure python
> source codes. However, the same question lies, how can it (set of
> bytecodes) be made stable, like Java bytecodes, which are pretty stable?
>  Perhaps a better question will be, what techniques Java VM designers
> use that enables Java class files (and JAR files) to be stable and
> usable across versions that is lacking in Python?

The Java class file format is not any more stable than the Python .pyc
format - I think every major release of the JVM has changed details
in the class file format.

The difference is that the newer JVMs accept old class files, by
means of separate loader code for each class file version that was
ever released (and very possibly also support for class file versions
that were never released).

The same approach would be possible in Python, but nobody has
contributed code to do so. It is unlikely that future Python
versions will provide such compatibility with the current byte
code format, either, unless somebody steps forward and volunteers
to maintain that compatibility.

Maintaining this backwards compatibiltiy is a tedious and boring
task, given the many much easier alternatives, so that volunteers are
unlikely to jump in. Sun manages to provide the compatibility by
paying somebody to actually maintain it.

Regards,
Martin



More information about the Python-list mailing list