News for hackers. Stuff that matters.
Re:Jython 2.7.0 Final Released by 616c on Tuesday May 12, 2015 @11:11AM (#9532316)
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?

Re:Jython 2.7.0 Final Released by lmm on Tuesday May 12, 2015 @11:40AM (#9532558)
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.

Re:Jython 2.7.0 Final Released by codelike on Tuesday May 12, 2015 @12:22PM (#9532838)
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.

Re:Jython 2.7.0 Final Released by 616c on Tuesday May 12, 2015 @05:47PM (#9535169)
Seen it every time I look into Jython and stumble upon their docs. Still curious if anyone uses it.
Re:Jython 2.7.0 Final Released by sfilipov on Tuesday May 12, 2015 @12:34PM (#9532922)
The difference is that CPython and PyPy both have a GIL, while Jython doesn't.
Re:Jython 2.7.0 Final Released by 616c on Tuesday May 12, 2015 @05:48PM (#9535178)
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.
Re:Jython 2.7.0 Final Released by dragonwriter on Tuesday May 12, 2015 @04:03PM (#9534472)
> 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.

Re:Jython 2.7.0 Final Released by 616c on Tuesday May 12, 2015 @05:51PM (#9535197)
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.

Re:Jython 2.7.0 Final Released by gsnedders on Tuesday May 12, 2015 @12:10PM (#9532755)
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.

Re:Jython 2.7.0 Final Released by marktangotango on Tuesday May 12, 2015 @02:27PM (#9533821)
>> 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).

Re:Jython 2.7.0 Final Released by Twirrim on Tuesday May 12, 2015 @09:51PM (#9536264)
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)
Re:Jython 2.7.0 Final Released by 616c on Wednesday May 13, 2015 @06:02AM (#9537846)
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.

Re:Jython 2.7.0 Final Released by cookiecaper on Tuesday May 12, 2015 @01:10PM (#9533219)
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.
Re:Jython 2.7.0 Final Released by Freaky on Tuesday May 12, 2015 @02:02PM (#9533646)
Do you have anything to quantify "much, much worse"? From what I've seen they're roughly as bad as each other.
Re:Jython 2.7.0 Final Released by cookiecaper on Tuesday May 12, 2015 @07:20PM (#9535652)
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.