Alex headshot

AlBlue’s Blog

Macs, Modularity and More

Groovy is stuck in the groove?


It looks like all is not well in the Groovy camp. For those that don't know, Groovy is an agile dynamic language for the Java 2 Platform that has many of the features that people like so much in languages like Python, Ruby and Smalltalk, making them available to Java developers using a Java-like syntax. Only it appears to be stuck in the groove.

It's clear that the next-generation language is going to be based on a scripting language that doesn't require type information to be entered. The adoption of (statically) untyped languages, like Python or Ruby shows that simple (and powerful) tasks can be done without the need for static typing information. However, it's a common misconception that these languages are untyped; in fact, they have dynamic typing, but don't require it to be declared in the language itself.

Creating a language like Groovy was supposed to bring scripting into the domain of Java users, mainly by peppering clean-syntax languages like Python with { and } symbols. However, rather than design the language (and then implement it), it's grown by hacking.

Some things can evolve without forethought. Extreme Programming, for example, encourages the evolution of design rather than design-by-paperwork. XP works very well at evolving big, complex systems designed to do one thing very well, such as custom products. However, XP can run into problems with designing frameworks or other systems that are meant to be reused in many hypothetical ways. As a result, XP systems that evolve as frameworks (Eclipse is one such example) do so in fits and bursts. and where possible, backward compatibility has to be provided between framework hops. That's a lot more than most people know how to handle, or at least, handle well.

But what about programming languages? Can they evolve without forethought? To be honest, a programming language is nothing more than a framework; except that instead of exposing APIs as callable functions/methods, the language is exposed as a function of the syntax and symbols that it understands in source code. It's not the same as a product, and it can be used in an indefinite number of ways (assuming it is a turing complete language). The language specification is the contract that binds the programmer and the developer of the language together.

Except that Groovy hasn't got one. As a result, the language is reminiscent of a few good ideas between Python and Java (and Ruby, although unlike Ruby, Groovy gets the definition of closures repeatedly wrong). But, like most hybrids, they are born infertile and unlikely to last out a generation. That's not to say the idea was bad, but it's not clear if the language is even stillborn; when I wrote about it six months ago, I was expecting a release of the language that could be released to the world in general as a fixed release. [Before anyone writes in; I know that it's been around in the dev- tree for ages, and that some people find it stable. But like Firefox, until it makes 1.0 release, it doesn't show up on the scanners of PHBs then it's not considered stable or usable. One of the big reasons why Subversion hasn't really made that much of a dent yet in business was that it sat around for ages as dev-, and pretty much as soon as 1.0 was released, 1.1 was hot on its heels. Where is release management when you need it?]

What was also interesting was that Groovy was also submitted as a JSR standard. I don't know why it should have been; there wasn't much of a standard beforehand, and the JSR team doesn't seem to have added much to it. And it's not really much to do with the Java language, any more than Jython or BeanShell are. (And both of those are being used in a lot of places, and are generally seen as nicer to work with; is there anything that these can't do that Groovy can?)

Let this be a lesson to all who design a language. You've got to think about the language carefully before you implement it. It's OK to have committees, and it's OK to have a benevolent dictator. But not if you are just hacking something together.