Stephen Ramsay    Home

Feelin' Groovy

Well, it’s time to pick up another programming language.

I’ve been doing this about once a year since the late nineties, and in that time, my motivations for programming glossolalia have changed a few times. At first, I think I mostly wanted to jump on the latest bandwagon. I was also highly susceptible to arguments from more experienced hackers about how such-and-such a language was the Greatest Thing Ever. But after awhile, I found myself wanting to study languages because I find them completely fascinating. Nowadays, I think it’s just a way to expand my thinking about what languages are and what they can do.

But honestly, after doing this ten or twelve times, I find that I’m beginning to stray into the outer rim. What’s next? Haskell? Erlang? I had more or less decided that I’d do one of those over the summer, but a couple of days ago I stumbled on Groovy.

What’s Groovy? A language with an absurd name, for one. But beyond that, Groovy (according to the home page):

I’ve used a few alternative languages for the jvm, including JRuby, Jython, and Kawa. I mean, what’s not to like? The syntax of Ruby, Python, or (be still my beating heart) Scheme with all the might and magic of the Java class library? What could be better?

In my experience, the original languages and runtime environments are better. I don’t know what it is. I always feel like the Javish stuff just don’t belong there somehow — like it’s some kind of crude hack. And before I get hate mail, let me say that these implementations are not crude hacks. They’re very skillfully done. There’s just something about the mixture that doesn’t sit well with me.

I haven’t started looking closely at Groovy yet, but I can see the general plan. They’ve taken some of the best ideas from languages like Ruby, Perl, Python, and Smalltalk, kept the general contours of Java’s C-ish syntax, and built a scripting language that has all the soul-stirring power and ubiquity of the Java class library in a nice little package. And, of course, it’s trivially easy to embed Groovy in Java or to integrate them in some other way.

Now, I might find it annoying (that is: slow, or poorly documented, or whatever). But if it really does have the ease of use and expressive power of a good scripting language, I may start teaching it in my Digital Humanities courses. I’ve been teaching Ruby to English majors for a number of years now, and I still think it’s a magnificent teaching language. But if Groovy was similarly good for teaching and allowed an easy migration path for students interested in Java, I just might be sold. Java is the dominant language in dh, and while a few of my students have been able to pick up Java after learning Ruby, it would be nice to have a language that was semantically closer to Java. I could imagine a class that goes through Groovy, and then ends by starting off with Java. But then, Groovy really would have to be groovy.

They will have to change the name, though. Can I really have a course description that says we’ll be learning Groovy?

I’ll report back when I’ve played with it some more.

blog comments powered by Disqus