JPython?

Bob Hays, Computer Geek rhays at interaccess.com
Fri Oct 15 06:11:47 EDT 1999


On Wed, 13 Oct 1999 15:00:07 -0500, Dan Star <danstar at execpc.com>
wrote:

>Let me see if I am understanding what JPython is.  Is it a just-in-time
>compiler that translates python code to java byte-code so that the
>python code can run in a WEB browser that supports java?  If so, I would
>assume this places many restricitions on the Python language elements
>you can use.  Or is JPython a seperate implementation of Python with its
>own language set?

>From our perspective (as a place about to install a production system
using JPython), JPython is a python interpreter written in 100% pure
Java(TM) that converts CPython (that's traditional Python written in
C) scripts to Java bytecodes that are executed in the JVM.  This
bytecode can be saved to .class files.  The interpreter can be run by
itself or embedded easily inside other Java programs.  Java classes
and jar files in the classpath can be used like any Python class,
which means for example that we can use the same XML parser that we're
using in our Java classes inside the JPython interpreter; this
provides at least two very neat side effects:

1) Experience using Java classes == increased knowledge of using
JPython, and
2) Its easy to translate working and stable Python code into Java code
for increased performance and sharing with non-JPython Java software.

Our experiences have been very good with JPython;  staff have learned
Python quickly (typically 1 - 3 days) and have found tremendous
speedups in development.  For efforts where the user just doesn't know
what they want, JPython provides a good prototype environment.  And,
it took me about 15 minutes to translate a JPython method to a method
in a Java class (once it stablized and worked).

Once it gets delivered, I'll post something about the project to the
page Barry has set up to track users of JPython.

Have fun! - Bob




More information about the Python-list mailing list