Skip to main content

Groovy, Baby!

Posted by monsonhaefel on January 13, 2004 at 3:12 PM EST
James Strachan and others have been working on an awesome new scripting language for Java called, Groovy. I met James at the ApacheCon conference last year and he made me a convert to Groovy – its really a beautiful language and fairly easy for Java developer to learn. What makes Groovy really cool is that it integrates seamlessly with Java programs and is actually compiled into Java byte code. You can call methods in classes in regular Java packages (classes) from Groovy and vice versa – that's powerful.

Groovy combines features of Python and Ruby (two popular scripting languages) into a Java friendly syntax. It makes working with object graphs (e.g. a bunch of business objects that have complex relationships) really easy – it's great for working with collections, XML and HTML. There is also support for regexp, SQL and scripting of Ant tasks.

Groovy saw its first release last December 2003, but its still very much a language with room to grow. If you are interested in getting in on the ground floor of what I believe will be an important new scripting language, than please visit the Groovy web site and see what you can do – testing code is always a big help. Personally, I hope to help with the documentation of this language.

The bottom line is that Groovy is not a replacement for Java – it’s a tool you can use to be more productive with Java. Groovy's not a silver bullet either. I can imagine lots of scenarios where I would prefer to work with the Java programming language, but its very useful in certain circumstances especially when organizing and filtering object graphs or text data – for example text files or XML or what have you.

Related Topics >>