a first look at Jython

Posted by mop Thu, 01 Jul 2004 22:42:00 GMT

I’ve had my first in-depth look at Python and the Java implementation of the Python syntax: Jython. The goal was to create some scripts to generate simple reports on the status of a Java web app and back-end database.

A good thing: Python supports explicit character encoding of the program source. A bad thing: still not sure if there are any Python boolean primitives (Update: found the grammar, no boolean primitives yet).

Python’s syntax comes reasonably natural -- significant white space is less awkward than I expected. I have not explored the object model yet; instead I’ve been relying on (existing) Java classes to do the hard work.

Combining a well-defined scripting language with Java is a powerful idea. The scripts are short and readable, and the process was very efficient. There was re-use within the scripts themselves and they are not particularly fast, but that’s ok when writing quick and dirty reports.

If you’re interested, there is a lengthy comparison of the Java apple and Python orange, probably out of date. I stumbled on this while looking for the Python equivalent of javadoc (G: python + javadoc). I think the answer is pydoc.

Posted in  | no comments | no trackbacks

Comments

Trackbacks

Use the following link to trackback from your own site:
/articles/trackback/110

Comments are disabled