Python and Jython
mmaru at attcanada.ca
Thu Jun 26 03:21:53 CEST 2003
I must say thank you very much. Very helpful explanation and advice.
----- Original Message -----
From: "Michael Chermside" <mcherm at mcherm.com>
To: <python-list at python.org>; <mmaru at attcanada.ca>
Sent: Tuesday, June 24, 2003 7:49 AM
Subject: Python and Jython
> Mulugeta Maru writes:
> > My background is Java. I would like to know the difference between
> > and Jython. Are they different languages? Should I learn Python first
> > then Jython? The reason I would like to learn the language is to use it
> > Java.
> Jython and Python are the *same* language. This doesn't mean that they
> are identical in all respects... there are several important differences.
> (back before EMCAscript was standardized) if you stick to the basic things
> they'll work the same way in both, but you can find lots of differences
> in the corners.
> The most important differences are the truly fundamental ones that
> having two different implementations. CPython (the proper name for the
> version of Python, although people usually just call it "python") is
> C. This means that it can be EXTENDED in C, and there are lots of useful
> extensions (and some built into the standard distribution) that exist for
> CPython which allow OS-specific features like Microsoft com objects and
> interrupts, or to c libraries (several windowing libraries for instance),
> c's speed (Numeric and libraries for doing scientific computations).
> none of these.
> Meanwhile, Jython runs on the java virtual machine (although that isn't
> an advantage on portability, since CPython is more portable than the JVM).
> most important feature of Jython is that Jython progams can call Java
> Java programs can call Jython objects, and the Jython can be compiled into
> pure (compiled) Java code! The level of inter-language integration is
> astounding, and makes Jython the perfect choice for scripting Java
> interactively examining Java code, and so forth. Also, it means that
> programs can take advantage of Java's huge libraries. They have fewer OS-
> specific features, but lots of useful things like JDBC, etc.
> The other difference that I've noticed is that a lot more people work on
> CPython than are working on Jython. As a result, CPython is a couple of
> versions ahead of Jython and keeps adding new features. Hopefully Jython
> attract more volunteers and manage to keep up (because some of the new
> are pretty nice).
> There are, of course, some syntactic differences... the page
> http://www.jython.org/docs/differences.html will list some, but it is very
> dated since CPython has changed a lot in since version 2.0 -- for
> says that CPython lacks circular garbage collection, but that has since
> added. Nevertheless, it's a useful guide.
> Since what you want to do is mostly to use Python with Java, I'd suggest
> you start out with Jython. You'll find that you can move to CPython
> and that nearly everything you learned in Jython will work perfectly
> that which depended on Java libraries).
> -- Michael Chermside
More information about the Python-list