Welcome Guest!
Create Account | Login
Locator+ Code:

Search:
FTPOnline Channels Conferences Resources Hot Topics Partner Sites Magazines About FTP RSS 2.0 Feed

Free Subscription to Java Pro

email article
printer friendly
get the code
more resources

Java Scripting Gets Groovy
A dynamic Java-like syntax for the JVM seeks to be the first standardized scripting language for Java
by Daniel F. Savarese

Posted April 21, 2004

Few programming experiences are as frustrating as squandering hours trying to fix a bug in your code only to find that the bug instead lies in a compiler or run-time library. When I was a teaching assistant in graduate school, invariably undergraduates would blame the compiler when they ran into an unusual behavior instead of carefully debugging their code. Although it was not unheard of for a compiler to produce bad code at times, I would encourage students to be more systematic and exhaustive in their debugging efforts before exploring the possibility of a flaw in the compiler. That was before Java. My early Java experiences were fraught with fighting bugs in the JDK libraries and the first generation of just-in-time (JIT) compilers. Every time I think those days are over, I either hear a story about JIT problems or run headlong into another Java fiasco.

ADVERTISEMENT

My most recent bad experiences have been caused by the java.nio libraries in J2SE 1.4. There have been several problems with the java.nio implementation on multiple platforms in each 1.4 release including the latest 1.4.2_04 SDK. To make a long story short, even though other java.nio bugs have been resolved, selectable I/O with nonblocking connects does not work. Don't waste your time. Shame on me for using Java for network systems programming. Different manifestations of the bug have been reported on the Java Bug Parade (see Resources), but it has gone unfixed since at least September 2003.

I've never been a vocal proponent of open sourcing Java, although I have been vocal about opening up the Java Community Process (JCP). My most recent bug experience has convinced me that Sun needs to open source Java and make it easy for Java developers to fix their problems and submit patches. I'm not claiming the following is a trend, but I'm not the only programmer increasing his use of alternatives to Java such as Python on the server and its wxPython offshoot on the client. I long ago relegated Perl for use in short programs because of software maintenance difficulties, but Perl 6 may change that. This is all to say that scripting languages supply Java's cross-platform programming capability and have done nothing but increase in popularity as Moore's law has remedied their performance deficiencies.

Not Another One!
The number of scripting languages available to programmers grows every year. Programmers like scripting languages because they are easy to learn, provide high-level functionality that reduces the time to develop programs, and often can be used to glue together disparate program components. Java has seen its share of scripting languages and tools. A sampling includes Jython, Jacl, NetRexx, Rhino, BeanShell, JRuby, JudoScript, BSF, and Swig. The latter two are tools for embedding scripting languages in programs and enabling interlanguage communication. Despite all of the options available already, an open source project called Groovy (see Resources) has submitted JSR 241 to the JCP seeking to make Groovy the first standardized scripting language for Java.




Back to top













Java Pro | Visual Studio Magazine | Windows Server System Magazine
.NET Magazine | Enterprise Architect | XML & Web Services Magazine
VSLive! | Thunder Lizard Events | Discussions | Newsletters | FTP Home