Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News State of Python on the JVM

State of Python on the JVM

Leia em Português

This item in japanese

In the last couple of years there have been a growing number of languages "ported" to the Java Virtual Machine (JVM) or created solely to run on the JVM. Some examples include Ruby (JRuby), JavaScript (Rhino), Groovy and Python (Jython). Specifically, in the past year or so Python has really been gaining a lot of traction on the JVM, thanks to the recent advancements of Jython. 

Jython is an implementation of the Python programming language designed to run on the JVM. It has been around for a little more than 10 years but it was in a fairly stagnant state for much of that time. More recently there has been a lot more going on in the Jython camp which is helping Python increase it's footprint on the JVM. InfoQ recently had the opportunity to interview the Jython project lead, Frank Wierzbicki, about Jython and the state of Python on the JVM.


Over the past year or so it really seems like there is more buzz surrounding Jython, why do you think that is?

I think the 2.5 release of Jython, which is more compatible with CPython than any previous release of Jython, has been a big part of that. We are able to run a much larger percentage of Python apps and frameworks than ever before. Django, Pylons, Py2Web are working well, SQLAlchemy 0.6 will work with Jython, and work is progressing on Twisted, TurboGears, and Grok (to name a few). All of this while being able to access Java libraries as if they where native to Python.


What's Sun Microsystems role in the development of Jython?

Sun allows me to work on Jython full-time. I have also been helping the NetBeans folks make Python and Jython a first class part of the NetBeans IDE, and getting Jython, Django, and Pylons working with GlassFish. And of course those teams are helping with Jython by incorporating it into their work.


What are the most important changes for Jython 2.5?

The focus of 2.5 was to make Jython a great, modern, CPython compatible implementation of Python. We really tried to make as many pure Python frameworks and applications work as we possibly could. We didn't put too much time into performance tuning, but we're looking at that next. That said, we perform reasonably well compared to CPython.


What's on the road map for Jython 2.6?

We are now looking hard at performance, but we are also adding plenty of features. For example, we are planning to improve our integration with Java libraries. In particular, we need to replace a tool from Jython 2.2.x and back called "jythonc" that made it more convenient to implement certain kinds of Java integration and package the results up in jars (One of Java's distribution formats). We were unable to support some of the new Python features with jythonc because of its internal design. We will also be making sure that even more applications and frameworks will work on Jython. We're looking forward to the day when having an app that doesn't run on Jython will be considered a bug in the app :)


Is there going to be a Jython3k?

Most definitely! 3.0 is the future of Python, and so it is the future of Jython. We have not started working on Jython3k in earnest, but I expect that we will get very serious about it once we release 2.6. The reason we are waiting for 2.6 is that the tools for migrating from Python 2 to Python 3 require 2.6 as a staring point.


Are you seeing Jython being adopted for more enterprise applications?

I have been hearing about people putting WAR files containing Pylons or Django on Jython into production, and I've heard of a few shops that find Jython's integration with JDBC is working better for them than CPython's database access in certain circumstances. The fact that 2.5 is a modern Python is making it a good choice in many situations.


I'm not sure people generally realize how old Jython is -- it's first release happened in July of 1998. At the time it was the most full featured programming language on the JVM outside of Java. So enterprises have actually been using it for a long time. For example, Jython is the admin scripting language for both IBM WebSphere and Oracle WebLogic.


What's your view on the state of python on the JVM?

Things are going very well for Python on the JVM. The Da Vinci Machine project led by John Rose has been working hard to make the JVM a better place for dynamic languages. This work is making its way into JDK 7 and will go a long way towards helping Jython perform screamingly fast once we are able to take advantage of this work. I am prototyping a Jython to take advantage of this work now.


Besides a lot of the work happening on the Jython programming language there have been other resources popping up surrounding the language including a new book about the language, a book about administering WebSphere with Jython, an online book, a podcast and talks and tutorials at PyCon. To get started check out some of the links above or head over the Jython Home Page for everything you'll need to explore Python on the JVM.


Additional Resources:

Rate this Article