File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Jython/Python and the fly likes Jython or Perl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Languages » Jython/Python
Bookmark "Jython or Perl" Watch "Jython or Perl" New topic

Jython or Perl

rinat amiel

Joined: Apr 05, 2005
Posts: 1
Hi all,

Currently in my company there is no standard for scripting language � most use Shell scripts on UNIX server.
I need to establish a standard for scripting language (Perl or Jython) when the following Comparison Criteria should be taken:

2.Modern language with rich functionality (especially String manipulation)
3.Does not dictate installation of freeware at production environment
5.Debug tools are available
6.Cross-platform support
7.No commercial restrictions
8.Reasonable CPU consumption

Thanks and regards,

Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
Read Python for Jython...
Jython is a Java implementation of Python after all

Python wins handsdown (or scores about even) on all criteria.

Neither will work on all hardware without installing some form of runtime, and on platforms where they do work it's because that runtime was already installed during operating system installation.
Both have commercial versions available, so you won't need to install anything that doesn't cost a few thousand dollars (there's no commercial Jython equivalent AFAIK byt there are commercial Python implementations).

Of course you need to question the wisdom of dictating a single environment. Will there be enough flexibility to select another if the need arises?
For example we use Unix shellscripts now where needed, but in some cases an AWK script is used instead.

M Beck
Ranch Hand

Joined: Jan 14, 2005
Posts: 323
like Jeroen, i'd use plain-old Python over Jython. i understand Jython is seeing development again, but it's got a ways to catch up with the mainstream language, and if the competition is Perl, then using the JVM version of Python would give you few advantages.

1. readability - goes to Python, easily.

2. could go either way, frankly; Perl and Python both do string manipulation well. Python has less of a bias towards regular expressions, though, and more of a culture of using string splitting, joining, substring parsing, and so on. this may make your string parsing more readable.

3. define "freeware"? Perl and Python are both open source and GPL compatible, but then again, they're both copyrighted, licensed software under decent control of their respective developers.

4. when you're discussing scripting languages, performance will not be stellar. if you really need that badly, you'll have to write in a systems language - even Java may well be too high-level if this is a high priority.

5. both languages have built-in debuggers. i have not used either. i know Python also comes complete with a profiler and a unit testing framework; i've used them, and found them good. i don't know if Perl has such functionality, but i can't imagine that it would be lacking; Perl is too serious a language for such an oversight. personally i do most of my debugging in the interactive interpreter; i think both Python and Perl have quite acceptable toplevels, for this purpose.

6. cross-platform compatibility is very good, for both languages. i've used Python on both Linux and Windows, and found it good. Perl has been cross-platform for many years, and is widely deployed.

7. you'll need to read the license agreements for each of the competitors, because only you will know just what sort of things you will want to do with the winner. they are, as i said, both GPL-compatible, but of course that doesn't mean you can't sell them.

8. CPU usage will depend at least as much on your program as on the language it's written in, but neither of these two have any very great overhead. again, though, when you're discussing scripting languages you won't find anything as lightweight as C or C++.
I agree. Here's the link:
subject: Jython or Perl
It's not a secret anymore!