BT
x Your opinion matters! Please fill in the InfoQ Survey about your reading habits!

State of Python on the JVM

by Craig Wickesser on Sep 27, 2009 |

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:

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Jython by Franklin Webber

In the language conceptual space I feel like it might be getting the losing deal (in my circles). It's a tough space with Groovy, JRuby, and Jython.

I employ Grinder usually for a quick load-testing framework when thrown on a project. Grinder V3 uses Jython as its glue. I found the documentation a little confusing at first. But I think that was because I started with file IO (which is python-like) and thought there would be more parallels. I realized it was Java and started having an easier go of it.

VM Language Tooling by William Louth

A benefit to all VM languages is that they can avail of tools that simply out-perform and out-scale their own native language counter parts. I just recently announced our upcoming resource metering extension for Jython which follows on from our support for JRuby with other VM language support in the pipeline.

williamlouth.wordpress.com/2009/09/29/the-faste...

Re: Jython by William Martinez

Hello.
We actually employ Jython in the creation of Pushtotest's TestMaker, since Python was a nice language to create test script.
Actually, TM supports all languages in JSR223 to create test scripts, but the problem is the actual migration of Libraries.
For instance, in trying to run a Mozmill script (with runners in Python) we faced that Jython had no direct support for some dlls in the windows space.
And for Ruby, some gems were not supported. So, it is a very good implementation, but may not work if your solution is "too native".

William Martinez.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

3 Discuss

Educational Content

General Feedback
Bugs
Advertising
Editorial
InfoQ.com and all content copyright © 2006-2014 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT