Groovy Continues to Evolve


I’ve been intrigued by Groovy, and the whole community ever since attending SpringOne2GX in 2009. I’ve written a few things using Groovy, Spock, Geb and use Gradle for all my personal projects.

Here are two recent presentations showing off new features of Groovy, and the features added to make Groovy very good for creating DSLs.

The DSL video is a bit long, but quite informative. They cover some simple things early on, so if you’re familiar with Groovy, skip to the last 1/2. They discuss providing additional information in the DSL’s jar file to aid both Eclipse and IntelliJ so they can provide code assist on your DSL. You can restrict the functions, methods, classes, imports etc that can be accessed in the DSL (as otherwise, it’s just running Groovy code, so someone could do System.exit(0) in their DSL, and cause havoc.

Groovy itself has a number of additional items for providing type checking, and static compilation. I tend to write Groovy similar to Scala in the sense of defining the parameter types of methods.

Personally, I’d stop writing Java and start writing Groovy or Scala today. I’m tired of waiting for Java to get the features, power and lack of verbosity of the alternative languages.