Pure Danger Tech


JavaOne: Script Bowl

02 Jun 2009

The script bowl is a panel session to show off different scripting languages on the JVM (although I think I would object a bit to calling most of these “scripting” languages).

The participants were:

  • Jython – Frank Wierzbicki
  • Groovy – Guillaume Laforge
  • Clojure – Rich Hickey
  • Scala – Dick Wall
  • JRuby – Tom Enebo

The judge was Robert Chinnici and there were two rounds – round 1 was an overview of the language features by the language advocates and round 2 were features from the community.

Round 1 – language features

Frank Wierzbicki did a quick info to Python showing off the general readability and simplicity of Python (“executable pseudo-code”). He also mentioned ease of dynamic typing and reflection.

Guillaume Laforge focused on some new features of Groovy 1.6, specifically compile-time metaprogramming. Groovy already had a lot of metaprogramming features and 1.6 allows you to trigger code transformations from annotations by allowing modifications of the AST before bytecode is generated. Some that were mentioned include @Singleton, @Immutable, @Delegate, @Lazy and some Swing ones like @Bindable, @Vetoable.

The Singleton example was just: @Singleton class Evil { } which would create the same kind of singleton boilerplate you might see in Java.

Rich Hickey focused on showing a multi-threaded version of Life and talking about how Clojure makes multi-threaded programming easier by allowing you to focus on how threads coordinate to solve a problem instead of thinking about shared state and locks.

Dick Wall took an interesting approach and looked at how some of the proposed features for Java 7 (Project Coin) are already supported in Scala. Specfically, he looks at “strings in switch” and better exception handling to show a bit of Scala’s match / case syntax. He also talked about support for type inference and ARM blocks, both of which are supported (in quite a bit more depth) in Scala.

Finally, Tom Enebo looked at JRuby and it’s ability to create readable DSLs, using as an example a DSL that made using the JMonkeyEngine 3D physics / scene library easy to use.

Round 2 – community

In round 2, each language advocate talked about community support and features. Rich focused on an IDE called Field used by artists at MIT to create various art projects that embedded Jython as the scripting engine. Guillaume talked about the Grails and Griffon and showed off some examples. Rich talked about the idea of code as data and how a community project is using this idea to make creating web apps simple. Dick Wall looked at a demo of how you could access CouchDB (an Erlang document db) with a Scala API that is being written by Debasish Ghosh. Tom looked at the breadth of the Ruby community in terms of number of conferences, books, Ruby implementations, IDEs, and libraries/gems.

In the end there was some audience polling and while I think there were strong advocates for all of the languages, Groovy seemed to be the clear winner.

As we learned at the recent Lambda Lounge shootout, comparing languages in a short format is a hopelessly doomed task, guaranteed to short-change all the languages without giving you much of the depth of any. I’ve dabbled in all of these languages and there are things I like about all of them – I hope they all thrive and grow.