Thoughts on Guido's ITC audio interview

Paul Boddie paul at boddie.org.uk
Sun Jul 3 18:21:24 EDT 2005


D H <d at e.f> wrote in message news:<zNydnS9-SMZgriPfRVn-qw at comcast.com>...
> Dave Benjamin wrote:
> > Someone in the audience surprised everyone by mentioning an actual project
> > attempting this, called javaclass:
> 
> Sounds like it really is converting java classes to python classes,

Yes, it is converting Java classes to Python classes at runtime using
an import hook, in fact.

> which are very different things.  Lot of limitations mentioned such as: 
> "It runs on the Python runtime which does not have the security, 
> threading and just-in-time compiler features that people enjoy about 
> Java runtimes"

The conversion done by javaclass relies on various limitations around
the Java class model compared to its Python counterpart (eg. single
vs. multiple inheritance), various things where the Python runtime is
a lot less fussy about classes and objects than the Java runtime is
(eg. the various low-level type-specific operations which can each be
mapped to the same Python bytecode), but also upon the similarities
that one would expect between any two mainstream virtual machines.
Python virtual machine instructions are more general than many Java
virtual machine instructions, but providing that the semantics are
preserved this should/does make the hosting of Java code
easier/possible.

Things like security and just-in-time compilation are arguably
orthogonal to replicating the semantics of most Java code, and since
the Python runtime is more conservative about concurrency, threading
becomes more of a performance/latency concern - again, an orthogonal
issue. For the proposal of javaclass and similar schemes as usable
tools, however, I would personally worry more about matching the
exception handling and import semantics of the two language systems -
those being things that have arisen as problems "on the ground".

Paul



More information about the Python-list mailing list