Hacker News new | past | comments | ask | show | jobs | submit login
PyJVM – JVM in Python (pyjvm.org)
88 points by xenator on April 8, 2014 | hide | past | favorite | 46 comments



Finally, the terseness of Java combined with the speed of python.


it's the worst of both worlds, for all to enjoy!


I saw what you did there. :)


There's a lot of questioning about why someone would do this.

Why can't someone just write for fun? Does everything now have to be "disruptive" and commercially viable?


A few years ago I wrote a Java decompiler. Not to actually decompile code but to learn how to use my weapon of choice (Java) at a deeper level.

I never finished. The only code I ever bothered decompiling was code I had written to test the decompiler. But I learnt a heck of a lot about how the JVM works, about Java byte code, and about some data structures and analysis. And I learnt exactly how the Java class file is defined.

It is something I'd highly recommend trying for your language of choice.


This is something I have been trying to find the time to do.

Something like this is great to learn how the JVM actually works, and can improve the way you code Java. I always found it incredibly boring to read language/vm specs but building something like this makes the abstract and obscure, concrete (at least for a programmer's brain)


It's definitely totally fine to build these things for fun, but with a landing page like this, it seems like the author built it for some purpose beyond that, otherwise I don't see the point in presenting it in this form.

If the author wanted to learn _and_ get publicity, a blog post or at least including a "why" section that says "just for fun" on the landing page would seem suitable to me.

There probably is some interesting motivation for doing this, it's just not clear what it is.


> but with a landing page like this

You mean one of github's default landing pages for projects? http://i.imgur.com/nQgmrE5.png


Exactly, just do it for fun. Much can be learned and created that way.


So I have to wonder.... why? If I was you I would put the link to https://github.com/andrewromanenco/pyjvm/blob/master/WHY.md front and center. That's great that it was done for academic purposes but I didn't understand that from the main page.


That's an interesting take of the Python and Java relationship and although it complements well the landscape (with Jython, JPype, Pyjnius, and Py4J), I'm not sure what the need is.

(shameless plug warning) When I created Py4J (http://py4j.sourceforge.net/), I wanted to decouple the two ecosystems as much as possible so that both could evolve independently. There is no jni, no re-implementation of bytecode or interpreter, just plain sockets working on linux, mac, windows and most versions of Python and Java.


Can we run Jython on it? Why? Just because.

EDIT: Also if it can run on Jython that would make a nice full circle. EEDIT: Looks like it requires Python 2.7 so this might not be the case (yet).


I can see it now

PyJVM --> Jython --> PyJVM --> Jython ...

It reminds me a bit of LISP interpreters that are mostly/entirely written in LISP.


I am usually fine with "because we could" as a justification, but . . . why? It's like making a hamburger out of lobster, Kobe beef, and truffles.


That sounds awesome in its own way. You could probably make millions in Houston with a restaurant featuring that.


There actually was a 'millionaire lunch' at a restaurant in Houston that was along those lines. Served with a glass of Silver Oak, as I recall.


There's a $100 Philly cheese-steak that literally contains all three of those.



Google that burger. I would label it a stunt, but it is something that someone has made.

Edit: The moderately less farcical versions don't seem to mix the lobster and truffles.


Okay. Wow. Things like that are a little outside my experience, but I think my point stands, perhaps even enhanced a little.


Not quite a burger but Tournedos Rossini [1] exists. This is a fillet steak topped with foie gras and served with black truffles.

[1] http://en.wikipedia.org/wiki/Tournedos_Rossini


Programmers add abstractions just as fast as Moore's Law adds speed.


I think you underestimate how quickly programmers can add abstractions.


Does anyone make a JVM that can save its memory image in the style of Smalltalk and Lisp VMs? This would give a potential solution to the Clojure startup time problem. (There was a JVM on Smalltalk named Frost.)


Check out drip?


I'm using it. It cut the startup time in half. Saved memory images could do much better.


If JVM is your thing, Doppio is a JVM in TypeScript.

https://github.com/int3/doppio



This can be stacked in multiple levels, cool :) JVM on Python on JVM on Python on JVM...


Needs Parrot and Javascript in there somewhere though, for maximum coolness factor.


On the flip side there is Python on the JVM :)

http://crudzilla.com/assets/img/info-graphics/lang-demo.gif


And if I recall correctly Graal, the next generation Java JIT Oracle is working on is also working on Python support. By far not there yet but pretty cool to see them take their compiler efforts beyond Java.


AFAIK this refers to ZipPy:

https://bitbucket.org/ssllab/zippy


What is it?

http://socalpls.org/slides/zippy.pdf

It is a performant implementation of Python3 on the JVM.


Looks like it, thanks for the link, wasn't aware this was open sourced yet


What is a use case for this?


There isn't one. More helpfully, the author describes it as a learning experience. How to implement a stack-based virtual machine in Python.


You are using a computer that has Python installed, but not Java (perhaps for security reasons). But you need to run some Java code.


I would rewrite the title to read "JVM in Python".


>Requires python 2.7

Why? It's dead, accept it.


Dead? Python 2.7 seems to be Good Enough(TM) for much of the industry titans that I don't think we'll ever see widespread Python 3.x adoption within the heavy-weights' infrastructure.

Python 2.7 is far from dead, and the changeover to Python 3 seems to be similar to Perl5->Perl6 -- or, more to the point, not happening at all.


Python 2.7 is still dead.

>Short version: Python 2.x is legacy, Python 3.x is the present and future of the language

>Python 3.0 was released in 2008. [6 years ago] The final 2.x version 2.7 release came out in mid-2010 [4 years ago], with a statement of extended support for this end-of-life release. The 2.x branch will see no new major releases after that. 3.x is under active development and has already seen over four years of stable releases, including version 3.3 in 2012. The next release is the upcoming Python 3.4 in early 2014. This means that all recent standard library improvements, for example, are only available by default in Python 3.x.

https://wiki.python.org/moin/Python2orPython3

There is still software for DOS around, and DOS is still dead.


Windows XP still seems to be Good Enough for the industry titans. (My desktop machine is still XP, due to move to win7 in the next few days, granted, but I'm typing this on XP)


Not exactly - I see it happening sporadically based on the expected longevity of the project, more this year than last.


shit works, yo, and python can only blame itself for so many people (myself included) remaining with 2.7.


Exactly 2.x was good enough that it's hard to make something so much better that it compels people to rewrite substantial code-bases.




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

Search: