Brandon Werner

Scripting makes Java fun again, and maybe relevant again, too.

When I interviewed Bruce Tate a few months before his Comp. Sci. best seller Beyond Java came out, he introduced a term that has always stuck with me:

“Java is dead like COBOL”.

What he meant was that although the Java language will certainly go on in the future as a legacy language and find new implementations from lovers of familiarity and the haters of change, the future of languages most likely has moved on. To see it, look at C# or Python or Ruby, where their creators talk about lambdas, functional composition and closures. He did mention, however, that the JVM would continue to be an important and vibrant piece of technology even after Java has been moved to the dust bin. His pronouncement was in late 2005, before the idea of a scripting plug-in to the JVM was even formalized (but Microsoft’s CLR was realizing the promise of the JVM abstraction much to Sun’s chagrin)

Today I have an example of that future.

Everyone knows that the JVM has hidden gems that, because of past mistakes and present misconceptions, go unused. One of these is SWING and Java2D. While Adobe’s Flash and Microsoft’s XAML are taking a lion’s share of the buzz on rich web applications (which is really aimed at removing the restrictions of the web browser from the application process all together, and something I am definitely fond of) it is often forgot that the JVM also provides this technology in spades. Sadly, it would seem that this is something else that the JVM has an answer for but will lose to those with easier implementations. One of the promises of new scripting languages being plugged in to the JVM is that this functionality can be exposed in new and better ways. Browsing LtU today, which often depresses me that I can’t just sit in a tree and program Haskell and Scheme all day, I came across a Sun employee Chris Oliver who wrote his own scripting language called F3 (Form Follows Function). It is suppose to be better than JavaScript (static typed and compile-time error reporting) and exposes all of the Java2D and Swing stuff easily.

That would be an understatement of his accomplishment.

I was floored by his example in his post below, where he wrote a new frame for the Fantastic 4 trailer using his new language. Most amazing, because it can leverage the entire platform and delivery mechanisms of the JVM, it uses Java WebStart to push it your machine. He even creates a Mac-like reflection by painting the video off the y coordinates using a negative scale… all in real-time… all in two pages of script.

The results are amazing.. Link here

Some more discussion of his work regarding this example is here.

This shows how the Java platform may have a life post open-sourcing and light-weight framework trends, and will continue to influence how we write and deploy applications. Although most of the press around scripting engines in Java has been around Python and JavaScript, the real potential lies in allowing levels of abstraction on JVM functionality, not just allowing languages to mingle inside one runtime.

Brilliant.

One Response to “Scripting makes Java fun again, and maybe relevant again, too.”

  1. Shai Almog Says:

    I pretty much agree that scripting is a huge direction for Java, although I think Tate’s COBOL comparison is BS: http://jroller.com/comments/vprise?anchor=save_java_from_cobol_s

Leave a Reply