Choosing a Java scripting language: Round two

If you are considering hooking a scripting interpreter into your Java application, the hardest part is choosing which one to use

1 2 3 Page 3
Page 3 of 3

BeanShell is not as fast as the quickest of the interpreters, but the 2.0 release supports loading of ordinary Java source, which is a strong selling point. I tried loading and running several Java source programs as scripts and found BeanShell to work fine, which is impressive. The libraries are well-organized and make integration simple. If performance is not the single most important criteria for your scripting interpreter and you want to write Java scripts, look at BeanShell.

Rhino is the winner of the performance benchmarking test and also supports Java-like syntax in its scripting. There are plenty of books on JavaScript available. Rhino appears to be well supported, and the distribution includes a useful debugger.

Pnuts is one of the fastest scripting interpreters. I am impressed with the completeness of the documentation, the simple usability of the debugger, and how straightforward it is to get things working with Pnuts. If the Pnuts syntax is a good fit for your needs, this interpreter deserves a good look.

JudoScript is in the middle of the pack for the performance benchmark, but supports a JavaScript-like syntax that is easy to learn. The documentation seems to be thorough and well organized, and the distribution includes lots of script examples. I ran version 0.9, which seemed to work well.

JRuby brings the feature set of Ruby to the table. It isn't the fastest of the interpreters, but if Ruby syntax and functionality is important to you, take a look at this interpreter. I ran version 0.8, which seemed to work just fine for my simple tests.

Groovy has attracted quite a bit of attention and development effort in the Java community. It is one of the fastest interpreters on the benchmarking tests, even without compiling the scripts down to classfiles. The syntax is Java-like and supports some powerful features that Java doesn't. This is an interesting addition to the programmer's toolkit that has a lot of potential.

David Kearns is a Sun Certified Programmer and Developer for Java 2. He has 15 years of experience designing and developing electronic design automation (EDA) tools and object-oriented application frameworks in C++ and Java, including 5 years of experience building commercial Java applications for configuration management, process control, tool scripting, and design simulation waveform viewing. Kearns works at Mentor Graphics Corporation in Wilsonville, Oregon as a staff engineer. His current project at Mentor Graphics is developing a high-performance schematic entry tool.

Learn more about this topic

1 2 3 Page 3
Page 3 of 3