473,836 Members | 1,505 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python + Java Integration

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....a ll 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.P ython 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/...thonjava-open-
sourcecommercia l

Cheers,

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

ce******@snowti de.com
http://snowtide.com | +1 413.519.6365
Aug 23 '06 #1
6 3011
Chas Emerick wrote:
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.

--
Ben Sizer

Aug 23 '06 #2
Chas Emerick wrote:
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
Aug 23 '06 #3

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.

Aug 23 '06 #4
Ben Sizer wrote:
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>

Aug 23 '06 #5
Fredrik Lundh wrote:
Ben Sizer wrote:
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
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.pytho n/python-list
archives for 1996-1998 might be informative to see how a community can
adapt sensibly to such events.

Paul

Aug 24 '06 #6
Fredrik Lundh wrote:
Ben Sizer wrote:

>>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>
"Java is Object-Oriented COBOL":

http://www.artima.com/weblogs/viewpost.jsp?thread=42242

regards
Steve
--
Steve Holden +44 150 684 7255 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://holdenweb.blogspot.com
Recent Ramblings http://del.icio.us/steve.holden

Aug 28 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
4627
by: Erik Johnson | last post by:
This is somewhat a NEWBIE question... My company maintains a small RDBS driven website. We currently generate HTML using PHP. I've hacked a bit in Python, and generally think it is a rather cool language. I've done Perl and like it, there are a few features of PHP I like but overall am not too excited about it. I have found PHP's strtotime() function to be quite flexible and handy and we make liberal use of it. I have not yet really...
1
3038
by: bezeee | last post by:
At my work we are in the process of building a tool to test an XML based API. Basically, XML in and XML out over http. Currently, there are two engines that do all of the schema validations, xml diffs, sending/receiving, etc. One of these engines in implemented in C# and the other in Java. Now the choice comes down to which scripting language we choose (Perl, Python or Jython) to tie into one of these engines. The scripting language...
3
2167
by: gohaku | last post by:
Hi everyone, I would like to know if it's possible to use python (libraries) in a Java Program. I do not want to use: Process proc = Runtime.getRuntime.exec(command) I am basically looking for something like the "Reversed" version of Jython. Thanks in advance. -gohaku
36
6419
by: Andrea Griffini | last post by:
I did it. I proposed python as the main language for our next CAD/CAM software because I think that it has all the potential needed for it. I'm not sure yet if the decision will get through, but something I'll need in this case is some experience-based set of rules about how to use python in this context. For example... is defining readonly attributes in classes worth the hassle ? Does duck-typing scale well in complex
25
5777
by: abhinav | last post by:
Hello guys, I am a novice in python.I have to implement a full fledged mail server ..But i am not able to choose the language.Should i go for C(socket API) or python for this project? What are the advantages of one over the other in implementing this server.which language will be easier? What are the performance issues?In what language are mail servers generally written?
8
4226
by: Dave Potts | last post by:
Hi, I'm just starting a development project in Python having spent time in the Java world. I was wondering what tool advice you could give me about setting up a continuous integration environment for the python code: get the latest source, run all the tests, package up, produce the docs, tag the code repository. I'm used to things like Maven and CruiseControl in the Java world. Cheers,
2
6977
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
5
3325
by: Hussein B | last post by:
Hi. Please correct my if I'm wrong but it seems to me that the major continuous integration servers (Hudson, CruiseControl, TeamCity ..) don't support Python based application. It seems they mainly support Java, .NET and Ruby. Can I use one of the previous listed servers for Python project? Thanks.
0
10846
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10551
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6979
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5650
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4458
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4021
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3116
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.