Summary
The Groovy project released Groovy 1.0, a dynamic scripting language for the JVM that borrows elements from Ruby, Python, and Smalltalk. The final 1.0 version of the language contains significant changes from earlier Groovy implementations, such as a new meta-object protocol, an improved type coercion mechanism, and a new closure syntax.
Advertisement
Groovy project lead Guillaume Laforge announced the final release of Groovy 1.0:
A lot of passion and energy has been put in this new version after two release candidates that have been tested against real-world projects: on a mission-critical insurance application, on the XWiki 2nd generation wiki engine, as well as on the RIFE framework and through the Spring 2.0 scripting integration.
The Groovy 1.0 distribution is available from the project's CodeHouse home.
The 1.0 release is a culmination of over four years of work on the language, and contains many significant changes from early Groovy versions. Commenting on the first 1.0 release candidate, Laforge noted that Groovy 1.0 includes a new meta-object protocol, or MOP, that determines how the Groovy interpreter dispatches method invocations. Groovy 1.0's MOP provides dynamic language advantages for Groovy programs by allowing users to customize Groovy language constructs:
This release contains a re-implemented and reworked Meta-Object Protocol, which is the core of Groovy's runtime system which decides how the dispatch of method calls, [and how] property and attribute access works. This new MOP brings more flexibility and a finer-grained control of those mechanisms.
In earlier comments, Laforge pointed to other notable Groovy 1.0 features as well:
Among the interesting improvements, you'll note that coercion mechanisms are improved and now customizable for your own POGOs through the asType(Class) method. You can even coerce Maps to interfaces, as well as Closures to single-method interfaces...
Another new feature is full-fledged support for the in keyword as a boolean operator to support syntax such as:
if (5 in 0..10) { ... }
6 in 1..12 ? "yes" : "no"
Support for Groovy's old, pre-JSR closure syntax was discontinued in the 1.0 RC. Instead of specifying closures with syntax such as {|} and {||}, closures are now defined with code such as def cl = {a -> ...}.
With a final 1.0 release, a plethora of features, and Java developers' increasing appetite for dynamic languages, do you think 2007 will also be the year of Groovy?