Python + Java Integration

C

Chas Emerick

This may seem like it's coming out of left field for a minute, but
bear with me.

There is no doubt that Ruby's success is a concern for anyone who
sees it as diminishing Python's status. One of the reasons for
Ruby's success is certainly the notion (originally advocated by Bruce
Tate, if I'm not mistaken) that it is the "next Java" -- the language
and environment that mainstream Java developers are, or will, look to
as a natural next step.

One thing that would help Python in this "debate" (or, perhaps simply
put it in the running, at least as a "next Java" candidate) would be
if Python had an easier migration path for Java developers that
currently rely upon various third-party libraries. The wealth of
third-party libraries available for Java has always been one of its
great strengths. Ergo, if Python had an easy-to-use, recommended way
to use those libraries within the Python environment, that would be a
significant advantage to present to Java developers and those who
would choose Ruby over Java. Platform compatibility is always a huge
motivator for those looking to migrate or upgrade.

In that vein, I would point to JPype (http://jpype.sourceforge.net).
JPype is a module that gives "python programs full access to java
class libraries". My suggestion would be to either:

(a) include JPype in the standard library, or barring that,
(b) make a very strong push to support JPype

(a) might be difficult or cumbersome technically, as JPype does need
to build against Java headers, which may or may not be possible given
the way that Python is distributed, etc.

However, (b) is very feasible. I can't really say what "supporting
JPype" means exactly -- maybe GvR and/or other heavyweights in the
Python community make public statements regarding its existence and
functionality, maybe JPype gets a strong mention or placement on
python.org....all those details are obviously not up to me, and I
don't know the workings of the "official" Python organizations enough
to make serious suggestions.

Regardless of the form of support, I think raising people's awareness
of JPype and what it adds to the Python environment would be a Good
Thing (tm).

For our part, we've used JPype to make PDFTextStream (our previously
Java-only PDF text extraction library) available and supported for
Python. You can read some about it here:

http://snowtide.com/PDFTextStream.Python

And I've blogged about how PDFTextStream.Python came about, and how
we worked with Steve Ménard, the maintainer of JPype, to make it all
happen (watch out for this URL wrapping):

http://blog.snowtide.com/2006/08/21/working-together-pythonjava-open-
sourcecommercial

Cheers,

Chas Emerick
Founder, Snowtide Informatics Systems
Enterprise-class PDF content extraction

(e-mail address removed)
http://snowtide.com | +1 413.519.6365
 
B

Ben Sizer

Chas said:
There is no doubt that Ruby's success is a concern for anyone who
sees it as diminishing Python's status. One of the reasons for
Ruby's success is certainly the notion (originally advocated by Bruce
Tate, if I'm not mistaken) that it is the "next Java" -- the language
and environment that mainstream Java developers are, or will, look to
as a natural next step.

Is it? I thought it was more along the lines of "you've been struggling
with Java to build web-apps all this time - here, have Ruby on Rails
which is much easier". Python provides just as much simplicity in the
web frameworks, but no consensus on what is 'best' (recent BDFL
pronouncement aside), and thus only a small community for each
framework. I bet that if Django or TurboGears had been fully ready for
prime-time before Ruby on Rails, we wouldn't be having this discussion.

As a language, Python is much closer to Java than Ruby is anyway.
People already migrate over to Python from Java in their multitudes,
bringing some odd assumptions with them. (eg. The whole thing about
'why isn't a Python static method equivalent to a Java class method?'
because they've been wrongly told that 'static' in Java signifies a
'class method', and because they never read the Python docs where it
clearly shows that classmethod != staticmethod. A bit of C++ knowledge
might have sorted them out here too, as it would have for many problems
encountered by people who were raised on Java, but I digress...)
One thing that would help Python in this "debate" (or, perhaps simply
put it in the running, at least as a "next Java" candidate)

Java itself never deserved to be the 'next' anything anyway. It was
sold on hype and has never lived up to it. I can see your point from a
business perspective but I like to think Python is sold on its merits
and not on being the new panacea for middle managers to deploy.
 
D

Diez B. Roggisch

Chas said:
This may seem like it's coming out of left field for a minute, but
bear with me.

There is no doubt that Ruby's success is a concern for anyone who
sees it as diminishing Python's status. One of the reasons for
Ruby's success is certainly the notion (originally advocated by Bruce
Tate, if I'm not mistaken) that it is the "next Java" -- the language
and environment that mainstream Java developers are, or will, look to
as a natural next step.

One thing that would help Python in this "debate" (or, perhaps simply
put it in the running, at least as a "next Java" candidate) would be
if Python had an easier migration path for Java developers that
currently rely upon various third-party libraries. The wealth of
third-party libraries available for Java has always been one of its
great strengths. Ergo, if Python had an easy-to-use, recommended way
to use those libraries within the Python environment, that would be a
significant advantage to present to Java developers and those who
would choose Ruby over Java. Platform compatibility is always a huge
motivator for those looking to migrate or upgrade.

While you might have a point with easing the transition for java developers
might favor them python over ruby, you seem to mix a few things here, and
forget about others:


- ruby has no notion of java-library support. So if anything lures java
developers from J2EE-land to rails, its the framework itself. Which, by my
standards, is at least met if not excelled by TurboGears and Django. So
it's marketing, but of a different kind, we need.


- jython, after a period of seemingly inactivity, makes huge progress
towards python2.2 and python2.3. Which will open up new possibilities just
the other way round: use existing, powerful python libraries written in
post-2.1 from jython, neatly integrating java and python. Now there is
jRuby trying to do the same for ruby - but I never heard of it before
(googled it for this post), so it seems not to be as important as jython
certainly is


Diez
 
H

hiaips

Java itself never deserved to be the 'next' anything anyway. It was
sold on hype and has never lived up to it. I can see your point from a
business perspective but I like to think Python is sold on its merits
and not on being the new panacea for middle managers to deploy.

Bravo. I could not have said it any better.
 
F

Fredrik Lundh

Ben said:
Java itself never deserved to be the 'next' anything anyway.

I've had a lot of developers come up to me and
say, "I haven't had this much fun in a long time.
It sure beats writing Cobol" -- James Gosling

</F>
 
P

Paul Boddie

Fredrik said:
I've had a lot of developers come up to me and
say, "I haven't had this much fun in a long time.
It sure beats writing Cobol" -- James Gosling

Nice quote! It also reinforces the impression that there are many
people working with technology who don't have very much control over
the tools they get to use - you could replace Cobol with VB in the
quote and it'd still echo the sentiments of a large number of
developers.

Of course, it's just not accurate to imply that Java had nothing to
offer: in an age when a number of languages provided support for safe
execution (Obliq, Telescript, Safe-Tcl, etc.) and where a few had
in-built support for concurrency (Ada, Occam, etc.), Java rather
effectively brought both of these and more to the mainstream. It may be
true that the language didn't justify the hype and that the API was
fairly badly designed in various places, but it represented a step up
for most developers, and the hype managed to give many of those
developers a chance or an excuse to use the language, rather than be
forbidden to use it because it didn't fit in with corporate or
organisational strategy.

There are parallels with Rails in the Java hype story: something better
than what lots of people are using (probably PHP in most cases),
combined with a dose of hype to persuade decision makers that everyone
else in the herd is moving in that direction, leads to something
suddenly becoming popular, being perceived as the next big thing, and
having lots of vocal evangelists who might seem like wise men to the
masses, but whose pronouncements on dynamic languages, for example,
seem belated and obvious to many of us. For those inclined to panic at
such a spectacle, a perusal of the comp.lang.python/python-list
archives for 1996-1998 might be informative to see how a community can
adapt sensibly to such events.

Paul
 

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
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top