Hacker News new | past | comments | ask | show | jobs | submit login
Jython 2.7.0 Final Released (fwierzbicki.blogspot.com)
120 points by wasi0013 on May 12, 2015 | hide | past | favorite | 33 comments



So we read a lot on HN about how JRuby has taken off, in terms of Chris Seaton's work with Truffle, Graal, and dynamicinvoke research for Java. JRuby, with efforts by him and sepearate work by others, has shown that jokes aside, porting successful languages or language styles to Java (JRuby, Clojure, Scala, and others) has real benefits. I mean even if you hate Java/JVM stuff, you can use paradigms and tools, partially or completely, on a stack you hate. For some of us that is a godsend, and I think it shows how cool open source programming is, where people are porting whole runtimes and languages to mix-match for their pleasure.

Now, with that in mind, I heard a long time ago, and it might be utter BS that Jython is way behind JRuby in terms of community, and very fairly, not as performant or robust bc there are only so many eyes for shallow bugs. Is this true? I see geovizer and others are making use of it, but others using it to good effect and it is worth their while?

I am now studying Java academically, and played with Python for years. The idea of doing Django-REST-Framework on Jython instead of learning Rails-API for JRuby as trial by fire exercise, at least in my mind, is more appealing. So anyone know how realistic this is?


I think the difference is that PyPy exists, so people who just want "a faster Python" tend to go there, whereas in ruby-land JRuby gets the people who just want "a faster Ruby" as well as those who want Ruby on the JVM.

Honestly I wouldn't recommend trying to use Django on Jython (I'd be amazed if it all works), or really doing anything on either Jython or JRuby unless you're already familiar with all of the pieces. To understand and debug Jython properly you need a good understanding of both Python and Java. For a first JVM project, find something good and idiomatic in Java (I hear good things about Dropwizard) and use that.


While I haven't used Django on Jython personally yet, there exists an official page in the docs about 'Running Django on Jython': https://docs.djangoproject.com/en/1.8/howto/jython/

So I'm guessing it should work fine and the comment above is probably too pessimistic about the situation.


Seen it every time I look into Jython and stumble upon their docs. Still curious if anyone uses it.


The difference is that CPython and PyPy both have a GIL, while Jython doesn't.


This is why I am surprised it is to hear about Jython, even here, where the GIL is thrown as a topic routinely any article with serious use of Python comes up.


> I think the difference is that PyPy exists, so people who just want "a faster Python" tend to go there, whereas in ruby-land JRuby gets the people who just want "a faster Ruby"

JRuby, IIRC, hasn't been particularly faster than MRI since MRI 1.9-ish, though it still has the advantage of no GVL for multithreaded apps.


Well, yes. You look at my comments and see I am interested in a recent post bemoaning how to build the simplest REST services possible in Java. So I know the name of the game.

I just want to see how this works if django-jython wokrs at all.


Jython long pre-exists any of the work on Truffle and Graal — the priority of the 2.7 release was just getting back to being compatible with an up-to-date Python release, and very little work was done on performance. (It's often faster than CPython for warm code, but also a lot slower than PyPy.) The majority of people who use Jython use it for interoperability with other JVM languages, rather than performance per-se.

There's also ZipPy, a Python 3 implementation based on Truffle/Graal. In some benchmarks, it far out-performs even PyPy, but it's very much incomplete so it's hard to make general conclusions as many (most?) larger benchmarks don't run.


>> Now, with that in mind, I heard a long time ago, and it might be utter BS that Jython is way behind JRuby in terms of community, and very fairly, not as performant or robust bc there are only so many eyes for shallow bugs. Is this true?

JRuby has Charles Nutter. No disrespect to Frank, but Nutter has really been a champion for dynamic langauges on the JVM, out in front, pushing all the time (JEP-191).


Agreed. I have to say, for the most part I keep running in to issues with Jython which I don't with JRuby. Note that Jython has focussed on language compatibility, and that doesn't include stdlib compatibility. That's where almost all my frustrations with it have come. Stuff just doesn't quite behave the same. Plus a number of major libraries, like Twisted, won't work on it for what on the surface seem to be bizarre reasons (https://twistedmatrix.com/trac/ticket/3413#comment:41 was the state of play 9 months ago and isn't changed now, you can see other conversation around problems with Twisted here http://bugs.jython.org/issue1521)


Well this has been the most detailed view into real-world attempts I have read so far, Twisted being a few steps more complex than Django I imagine.

Thanks for the detail.


Alternate Ruby implementations are much more popular because MRI is much, much worse than CPython in terms of performance and memory usage. Alternate implementations are therefore much less important for Python.


Do you have anything to quantify "much, much worse"? From what I've seen they're roughly as bad as each other.


All I have are personal anecdotes, but I know I've had several Ruby scripts that have had to be scrapped/moved to other implementations and/or languages because MRI wasn't actually removing objects, even when the garbage collector was explicitly called, and thus became exponentially slower as the script ran, or because memory usage just gets out of control and the script gets killed by the OOM killer. I haven't had any Python scripts that have encountered these problems yet, despite doing the same or very similar things.


I wanted to say "thanks" to the Jython team. I've been using Jython for a few years for a project (called STempo) that uses Java and Python. Jython has been a great bridge between them, we have run into a number of issues in the project but Jython has always been solid. The senior faculty on our project knows Python but not Java and she can happily develop in CPython and it always works fine when I bring it into Java-land (assuming no dependencies written in C have crept in). Bravo and thanks!


Awesome news! I hope this gets officially integrated into Vert.x 2/3 [0][1].

[0] http://vertx.io/

[1] https://github.com/rdolgushin/mod-lang-jython


I'm glad to see Jython make this progress. Unfortunately, it's still nearly 5 years behind Python itself---Python 2.7 was released in July 2010.[1] The leap to 2.7 is a huge deal, though, as that's the "gold standard" for Python 2 these days.

[1]: https://www.python.org/download/releases/2.7/


Is anyone working on Jython integration with project Jupyter?


Congrats! Very useful project. I chatted with one of the main developers on freenode and he was very helpful. I was trying to get Jython working better with RPyC which turns out to be a nice way to integrate CPython with Java libraries.


I read this as "finally released" :D


Congratulations to the Jython team! I do have one question though which I can't seem to find a recent answer for: How's the performance of Jython these days? Especially with the 2.7.0 release. The most recent answers I could find on Google were for 2.5 from a few years back which said it was about comparable with CPython. (if that's still the case, that's fine, I'm just curious about that as Jython could make a nice scripting language on top of a Java project and I'd like to be able to keep performance considerations in mind)


Check out Jim Baker's PyCon 2015 talk "Getting to Jython 2.7 and beyond[0]" and associated slides[1].

Using the test.pystone bechmark, it is 30-40% faster than CPython, but the team didn't focus on performance during this release, just compatibility. The performance increases are almost entirely from improvements in the JVM.

[0]: https://www.youtube.com/watch?v=hLm3garVQFo#t=1m32s

[1]: https://speakerdeck.com/wolevertest/jim-baker-getting-to-jyt...


Give it a shot. Very little work to get it embedded as a scripting language into an existing Java project. If performance becomes an issue look at Groovy, but it probably won't become an issue. Because its so easy to integrate you should just do it without even looking at performance.


> If performance becomes an issue look at Groovy

Or JRuby, Clojure, Scala, or Nashorn.


How is Nashorn these days? I remember seeing there was a big performance fix in one of the JDK8 releases, but I haven't seen anything approaching real world benchmarks, just some very synthetic impractical stuff.


Definitely worth trying--I've used it for the same purpose, and the only performance issue has been a slow startup time (several seconds to load standard libraries).


Do you know if it's possible to have the loading of the standard libraries offloaded to a separate thread? For example, if I have a program that displays a UI, can I have a progress bar or loading message (or even basic interactivity) using Java code while another thread gets the scripting part of the application spun up?


Yep, shouldn't be hard. There's pretty fine grained control over what gets loaded and when.


Now all we need is ctypes support :-)

Get cracking Stefan!


this is old news, it's from May 3.


why did you not submit it then?


Maybe because someone else already did so... https://news.ycombinator.com/item?id=9483231




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: