Wednesday, September 27, 2006

JPype success and horror stories

I was browsing the net recently, and thought it might be funny to google for "jpype". Boy was I surprised! Google reports nearly around 18400 hits!!!

Granted, most of those hits are archived repeats of usenet posts made over a year ago .. But still, I can see the interest.

What would like to know is who uses JPype. What projects. Why tried and failed (and why!). I'd like to make a page for JPype website with links to those projects.

It's always nice to see that my had works is actually benefiting someone else.

14 Comments:

Blogger veeck said...

My company is looking into using jpype for an upcoming project, but since we are just in the planning phase I cannot yet tell you a success (or horror) story. Of course I will keep you informed about it once its done.

3:02 AM  
Anonymous Anonymous said...

I do mainly text-processing and would like to stay in Python... my setup to run the Java program, then run Python on the output is pretty cumbersome. But like veeck, I've just discovered your work, so I can't tell you about its success yet.

5:47 AM  
Blogger Matthew Ranostay said...

I'm currently developing a report writing application using embedded Tomcat with JPype. Kick-ass tool, much faster than Jython.

8:39 PM  
Anonymous Anonymous said...

I'm using Processing.org's java graphics library. Some in our group would like access to this but without using Java. So I've tried Jython, Groovy, and even JavaScript interfaces!

Unfortunately they are too slow, by in large. You can see the prototype I'm trying by looking at the Eclipse and Processing article at http://backspaces.net/

So, I'm considering JPype to see if I can get to within half of Java's speed.


-- Owen

Owen Densmore http://backspaces.net
http://redfish.com http://friam.org

12:01 AM  
Blogger Steve Menard said...

If past experience is any indication, you should definitely get a big speed boost over Jython and Javascript , though I am suprised by Groovy.

If speed is still not quite good enough, please let me know. Depending on the issue, it may be possible to fix it and make it fast enough for your needs.

12:30 AM  
Anonymous Doug Daniels said...

I'd be interested to see if anyone has been able to use JPype to implement a microthreaded game engine.

Similiar to the EVE Online Stackless Python architecture ( EVE Stackless Python Architecture )

Also here's another describing how Stackless Python's microthreads are used in the Sylphis3D engine: Multithreaded Game Scripting with Stackless Python

My goal is to integrate some kind of microthread based architecture and scripting into a Java based OpenGL 3D engine, Java Monkey Engine.

You can check out a thread I posted about multithread game architectures and Jmonkey engine.

12:27 AM  
Blogger Steve Menard said...

That's a seriously intereting idea.

As far as I know it should just work, stackless' changes should not affect JPype. Microthreads all look like one real thread to the JVM, so that should work too.

However, if any of your microthread spend a significant amount of time in Java code, you may hit performance problems. From my (admitedly old) understanding, microthreads work by switching thread context pre-emptively at the Python VM level. When the thread is stuck in Java code, no such switching can occur, so you effectively loose microthreading.

Callbacks may also be a problem. GUI callbacks in particular usually happen in the GUI even thread, which is not the same thread. I have no idea how that would interact with microthreads.

Maybe the best solution is hybrid. Have distinct native threads for any thread that touches the JVM, but have as many microthreads as you want for "logic" that never leaves python code.

12:46 AM  
Anonymous Anonymous said...

Considering jype for feeding a SOA registry from python, using JAXR API.

9:24 AM  
Anonymous Anonymous said...

i used jpype in conjunction with apache xerces, xalan and fop to create pdf files from within wxpython. the main reason for this was to reduce pdf generation time from 20 seconds a pop (by calling the java command line) to a couple of seconds by calling the jvm directly.

7:38 PM  
Anonymous Anonymous said...

At Institute for Simulation and Softwaretechnology of the German Aerospace Center (http://www.dlr.de/sc/en) we are looking into Jpype in order to develop a way to write Eclipse-Plugins and OSGI-bundles in Python.

5:43 AM  
Blogger rino said...

I can't seem to make JPype work under Linux with anything other than Sun's JDK 1.4

I was looking into using JRockit, but that simply gives me a core dump (like Sun's JDK 1.5)

So, that's an horror story for me...

6:04 AM  
Blogger rino said...

I've only been able to use JPype under Linux with Sun's JDK 1.4.

Anything else (I was looking for JRockit) causes a core dump.

Plus I was attempting a quite convoluted exercise: call a python program from Java with Runtime.exec, and this python program uses JPype (Java program -> python program -> java library).

The JDK version of code that runs Runtime.exec matters! It also needs to be Java 1.4...

So, I am on the horror side of the fence :(

6:12 AM  
Blogger Steve Menard said...

Sorry to her that Rino. I hven't tested JPype with JRockit, but should just work, assuming JRockit properly implements all the part of JNI I use. I would not be surprised if there were issues with the Invocation API, which is rarely used.

I am more alarmed with the JDK 5 problems. I am pretty sure I tested this with success. Perhaps you can enter a bug report on Sourceforge abou it?

10:08 AM  
Blogger Eric said...

I'm evaluating JPype in order to interface with HTTPUnit.

My organization (Zillow.com) uses Python+Mechanize for HTTP tests, and Ruby+Watir for UI tests.

We'd like to move all tests into Python, but in order to do that we need our browser simulator to execute JavaScript. (Mechanize doesn't go that far.)

I think HTTPUnit may do the trick, but to use it from Python I will need an interface like JPype.

We'll see if I can get it working. :-)

2:20 PM  

Post a Comment

<< Home