Will GPL Java eat into Python marketshare?

H

Harry George

Dennis Lee Bieber said:
Most unlikely to happen... I don't really see anyone going to the
effort to change the javac back-end to target a totally different
runtime engine.
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/

I once wrote a partial JVM in Modula-3 (strictly a researchware
effort), so I can imagine it being done technically. But why?

The big problem with Java-and-Python is not the VMs underneath. It is
the fact that Java has layers upon layers upon layers of idiosyncratic
libraries and idioms. When you write bindings to that world (even if
the bindings are generated automagically), you have to *think* in
those same layers. The Python-oriented developer suddenly has to use
a dozen imports in order to do things already done better in
Pythonesque libraries.
 
R

Ravi Teja

Personally, I've never gotten jpype to work. Is it just me, or is it
a troublesome install?

Harry George
PLM Engineering Architecture

It works fine for me now. However, I do recall having an issue a while
ago (most likely me, rather than JPype).
 
M

Maurice LING

I once wrote a partial JVM in Modula-3 (strictly a researchware
effort), so I can imagine it being done technically. But why?

The big problem with Java-and-Python is not the VMs underneath. It is
the fact that Java has layers upon layers upon layers of idiosyncratic
libraries and idioms. When you write bindings to that world (even if
the bindings are generated automagically), you have to *think* in
those same layers. The Python-oriented developer suddenly has to use
a dozen imports in order to do things already done better in
Pythonesque libraries.

The main use I can see is to be able to incorporate Java applications
into Python. For example, I am using Cytoscape (www.cytoscape.org) which
is in Java. I do hope that I can control Cytoscape from Python and
manipulate its objects from Python.

Say given cytoscape.jar, I'll like to be able to do this:

And the tighest way I see that this can be done is for Python VM to
execute Java bytecodes like Python bytecodes. That is, Python VM
executes Java bytecodes directly and not through object mapping which I
think is that JPyPe is doing.

I must say that this is part of even a fluffier dream that one day, I
can take any applications and play around with it in Python. Currently,
my collaborators wrote in Perl and Java, so it is not easy for me to use
their work in my work.

ML
 
S

Stephen Eilert

Maurice LING escreveu:
The main use I can see is to be able to incorporate Java applications
into Python. For example, I am using Cytoscape (www.cytoscape.org) which
is in Java. I do hope that I can control Cytoscape from Python and
manipulate its objects from Python.

Say given cytoscape.jar, I'll like to be able to do this:


And the tighest way I see that this can be done is for Python VM to
execute Java bytecodes like Python bytecodes. That is, Python VM
executes Java bytecodes directly and not through object mapping which I
think is that JPyPe is doing.

I must say that this is part of even a fluffier dream that one day, I
can take any applications and play around with it in Python. Currently,
my collaborators wrote in Perl and Java, so it is not easy for me to use
their work in my work.

ML

What is wrong with the other way around and Jython?

Just curious.


Stephen
 
M

Maurice LING

Stephen said:
Maurice LING escreveu:




What is wrong with the other way around and Jython?
Nothing wrong with the other way round - JVM executing *Python bytecodes*.

Cytoscape has a plugin with enables one to bring up Jython interpreter
but it is way too slow - make sure you start to load it up before lunch
if you want to execute a few lines of codes after lunch.

ML
 
P

Paul Boddie

Maurice said:
Say given cytoscape.jar, I'll like to be able to do this:


And the tighest way I see that this can be done is for Python VM to
execute Java bytecodes like Python bytecodes. That is, Python VM
executes Java bytecodes directly and not through object mapping which I
think is that JPyPe is doing.

This kind of thing is what I wanted to do with my javaclass experiment,
but I lost motivation/momentum after getting only some of the things to
work. Translating Java bytecodes isn't hard for most of the instruction
set, although exception handling was awkward at the time (before Python
2.5's new-style Exception class), and I'd have to think through the
interpackage referencing problem again (circular references are not
typically a problem in the Java package hierarchy). In the end, I
couldn't justify spending the time in order to use certain pieces of
software that weren't so compelling after all.
I must say that this is part of even a fluffier dream that one day, I
can take any applications and play around with it in Python. Currently,
my collaborators wrote in Perl and Java, so it is not easy for me to use
their work in my work.

There's always Jython, as I tell the occasional person who tries
javaclass expecting it to be better than it is. That Jython doesn't
support the latest CPython features shouldn't be as huge a problem as
people suspect, especially if you just want to glue Java packages
together with Python. Otherwise, the PyLucene approach (gcj + bindings)
might be an acceptable approach: a well performing Free Software
solution even before the recent Java licensing events.

Paul
 
M

Maurice LING

Paul said:
This kind of thing is what I wanted to do with my javaclass experiment,
but I lost motivation/momentum after getting only some of the things to
work. Translating Java bytecodes isn't hard for most of the instruction
set, although exception handling was awkward at the time (before Python
2.5's new-style Exception class), and I'd have to think through the
interpackage referencing problem again (circular references are not
typically a problem in the Java package hierarchy). In the end, I
couldn't justify spending the time in order to use certain pieces of
software that weren't so compelling after all.

I take a simplistic view that Java bytecodes is all that is to be dealt
with. And the book "Programming for the Java Virtual Machine" by Joshua
Engel did demonstrated in principle that it is possible to program in
Java bytecodes. There are also other researchware which tried to compile
other languages into Java bytecodes. I am not sure if exception handling
etc are dealt with before bytecode level. I also envision that the core
implementation of JVM is a big switch statement, just like in Python VM
(the bytecode executor).

Will it then be the case of adding the set of Java bytecodes into Python
bytecodes and implementing Java bytecode operations? Or am I just
fooling myself here?

ML
 
P

Paul Boddie

Maurice said:
I take a simplistic view that Java bytecodes is all that is to be dealt
with.

Well, that and things like class loading. You'll need a library
implementing the "standard" Java API, although that's never been hard
to obtain, and the official implementation will be genuinely free to
redistribute before too long as well.
And the book "Programming for the Java Virtual Machine" by Joshua
Engel did demonstrated in principle that it is possible to program in
Java bytecodes. There are also other researchware which tried to compile
other languages into Java bytecodes. I am not sure if exception handling
etc are dealt with before bytecode level. I also envision that the core
implementation of JVM is a big switch statement, just like in Python VM
(the bytecode executor).

It's just an instruction set, but with some fairly "complicated"
instructions, just as you find in the Python virtual machine
instruction set - don't expect them all to be like RISC instructions,
or even traditional CISC instructions.
Will it then be the case of adding the set of Java bytecodes into Python
bytecodes and implementing Java bytecode operations? Or am I just
fooling myself here?

Take a look at the code, although you might want to steer clear of the
import hooks initially:

http://www.python.org/pypi/javaclass

Paul
 
D

Dennis Lee Bieber

The main use I can see is to be able to incorporate Java applications
into Python. For example, I am using Cytoscape (www.cytoscape.org) which
is in Java. I do hope that I can control Cytoscape from Python and
manipulate its objects from Python.
Given that you are talking a whole Java application and just want
Python for scripting it... Sounds more like Jython's forte...
I must say that this is part of even a fluffier dream that one day, I
can take any applications and play around with it in Python. Currently,

Fifteen years ago, the Amiga got close -- using ARexx; many
applications incorporated ARexx ports (IPC channels) through which one
could transfer commands/data (a near transparent AND interactive
"popen", if you will -- any "statement" that could not be parsed as
ARexx would be passed to the application), and some supplied ARexx
libraries that directly interfaced with the application (I think M$ COM
might be the equivalent -- but an ARexx library, once "installed" added
the functions/procedures as ARexx native).
--
Wulfraed Dennis Lee Bieber KD6MOG
(e-mail address removed) (e-mail address removed)
HTTP://wlfraed.home.netcom.com/
(Bestiaria Support Staff: (e-mail address removed))
HTTP://www.bestiaria.com/
 
B

Boris Borcic

Harry said:
Personally, I've never gotten jpype to work. Is it just me, or is it
a troublesome install?

It worked for my purpose (connecting to a 4D database via JDBC over Open4D, as
the ODBC driver for that db is really horrible) until I tried to use this setup
together with cherrypy, what crashed loudly and consistently for reasons I
failed to discern. Some initial [class]path issues, as well.

Cheers, BB
 
M

Michael

Intelligent people don't suffer from fanboy sentiments. They just pick a
language that works best for them.
I agree with the previous poster and don't think it's just being a fan
boy. Some projects require Java, or at least are easier in Java, such as
creating browser applets, but in the majority of cases I find Python
much easier to work in. The code is more terse and easier to read and
work with.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top