Hear me out. In 2 to 3 years from now there we will see strong indications that Groovy is replacing the Java language as the dominant language on the JVM. Actually outnumbering the Java language will be very hard, given its 10+ years of history. But the trend will be clearly with Groovy.
I realize this sounds like an extra-ordinary claim, maybe even sounds baseless. But it's not. I've recently come to terms with the increased adaptation of Groovy as a programming language myself. Before laying out my arguments to support the increasingly important role of Groovy, let me first lay out some of the history of the Groovy language.
The Groovy project for a long time has been a wild dream. Groovy is the dream child of James Strachan, extravagant open-source developer and visionary. While waiting for a delayed flight he was playing with Python and found it such a cool language that he decided the JVM needed to have a language like this too.
Groovy has always been closely related to the Java language. Not only is the Groovy syntax similar to and often identical to the Java syntax, Groovy is the only language together with Scala and of course Java that always compiles to true Java byte-code. This means that Groovy classes are always true Java classes.
But Groovy has known a rough history. I'm sure many people would prefer not to be remembered, but Groovy was on the brink of failure in 2003/2004. It got a lot of bad press back then and was written off by many people, including people that were involved in the project. Groovy made it through this storm thanks to the hard work of a team of very dedicated people. At the start of 2007 Groovy 1.0 was released and now we're looking forward for Groovy 1.6 and Groovy 2.0.
From the period of Groovy's near failure I remember that everybody had an opinion of what Groovy had to be like. Most people liked the Groovy language, but it had to be more like Perl, or more like Ruby, more functional, less Java, more Java. Every week there were enormous discussion on the mailing lists about which features Groovy had to support. This chapter in Groovy's history is behind us.
Since 2005 the Groovy team has regrouped and been working hard to improve the language. They've incorporated many suggestions and continue to do so until this day. But you won't find many discussions today on which direction Groovy should take. We're past 1.0, the language is stable.
Groovy is a dynamic language, meaning Groovy does not do type checking on variables if you don't want it. Groovy can do type checking but its optional. Here's an example of Groovy code that does not do type checking:
def list = []
assert list.empty
Here's the same code with type checking:
List list = []
assert list.empty
In a way, the Java language is a non-dynamic language that always does type checking.
So, why do I think Groovy will replace the Java language as dominant language? I'll break down my arguments in two categories.
First, why the Java language won't remain the dominant language:
java.util.Collection interface to support closures. For Groovy dealing with new methods on java.util.Collection would be a non-issue. This feeling of being stuck with certain types will increase the sentiment that the Java language may be at a dead end.So, then why should Groovy become everybody's favorite, especially now that Sun officially supports JRuby? And what about Scala?
It's going to be a very interesting 2 years for Groovy and Grails. The moment is ours and the demise of the Java language has to be Groovy's stepping stone.
Happy coding!
Note: as Graeme Rocher points out in the comments, Groovy won't compete with Java anytime soon on mobile devices.
Links:
[1] http://www.eclipse.org/
[2] http://www.jetbrains.com/idea/
[3] http://www.oracle.com/technology/products/jdev/index.html
[4] http://www.netbeans.org/
[5] http://code.google.com/webtoolkit/
[6] http://eclipse.org/aspectj
[7] http://www.headwaysoftware.com/products/structure101/index.php
[8] http://gafter.blogspot.com/2006/08/closures-for-java.html
[9] http://www.artima.com/weblogs/viewpost.jsp?thread=202004
[10] http://docs.google.com/View?docid=k73_1ggr36h
[11] http://weblog.raganwald.com/2007/01/closures-and-higher-order-functions.html
[12] http://ivan.truemesh.com/archives/000392.html
[13] http://groovy.dzone.com/news/higher-order-functions-groovy-
[14] http://wiki.netbeans.org/Groovygrails
[15] http://groovy.codehaus.org/The groovyc Ant Task
[16] http://groovy.codehaus.org/IntelliJ IDEA Plugin
[17] http://java.dzone.com/news/easyb-introducing-conversation