Another look at Groovy (Latest java based scripting language)
By Angsuman Chakraborty, Gaea News NetworkWednesday, November 3, 2004
I was recently pulled into Groovy, a new Java based scripting language. You can read a good article highlighting groovy in onjava.com.
Groovy adds several syntactic sugar to Java. By itself it should be nice. However considering that most Groovy developers are originally Java developers, it might promote habit development which they cannot bring back to Java. Also some of scripting niceties are good for scripting languages, yet feel out of place for an oo development language. Just bad habit forming is what I think.
Personally I have seen that when I am forced to do some coding in javascript, I have to be extra careful when I am back in Java, to avoid pages of compilation errors. In that sense I am more comfortable using BeanShell as it much more closely mimics Java.
With autoboxing, enhanced for loops and other jdk1.5 syntactic sugars Java is much easier to code with. My main gripe is public static void main
Some of the scripting elements in groovy are counterintuitive, more so probably because I haven’t been initiated in Ruby cult(?).
Groovy is a decent language as scripting languages go, however the target audience is what makes me uncomfortable.
Somehow I don’t feel the need to learn yet another scripting language.
Beanshell is slow as it is interpreted. So what we need is a compiled beanshell to get best of both the worlds. I think I just might have a solution. More on it later.
Looking forward for your comments.
PS. Yes JPython is good, but then I am not much of Python & Perl fan either. They are good for hacking, I would cringe to develop and maintain enterprise applications in them (not that it is impossible or it hasn’t been done).
March 23, 2006: 9:08 am
I have the same issue and I quote : |
January 16, 2005: 8:55 am
I don’t think we needed another scripting language… Seppia is combines ecmascript (javascript) into java and allows you to build any application from its constituent parts. |
November 23, 2004: 11:17 pm
Thanks everyone for your helpful comments and suggestions. |
![]() gab |
November 4, 2004: 10:18 pm
join the ruby cult we grant you happyness Emh.. sorry.. I meant.. Maybe what you want is a type inferencer for java. In that case I suggest you take a look at Nice. It is basically a better java featuring real closures, multimethod dispatch and type inference. Nice seems quite strange at a first look, but indeed it is very powerful and pleasant language, and compiles to bytecode withouth great performance losses (au contraire that groovy) |
November 4, 2004: 4:43 am
Groovy is pretty nice. I was skeptical too at first, but then I caught Dion Almaer’s prez at the No Fluff Just Stuff tour in Boston a couple weeks ago. The amount of syntactic sugar is dizzying. It is significantly different from Java, enough to make it just another programming language. I mean, what you said about switching between languages for Java and Groovy you could just as well say about Java and Ruby or PERL. They’re just different (although, sure, you could code Java in Groovy, but why?). The main things I like about Groovy are the support for XML, Ant, Web services, closures, the ability to code Strings without worrying about concatenation, the execute() method added to the String object, and the fact that you can compile Groovy scripts to Java class files, which implies, for example, you can now compile Ant builds into class files and deliver a jar instead of an XML file for a productized Ant script. Plus, Groovy is in progress to be supported by the JCP as the first language other than Java to be standardized on the Java platform. That will ensure strong support for Groovy users/programmers for the future. |
November 4, 2004: 2:39 am
Based on your comments above, Janino seems like a reasonable match to your constraints. |
![]() javi moreno |
November 3, 2004: 7:44 pm
man, i’ll never understood why every body seems so scared to introduce new tools in their bags. groovy is just another great language with the same potential as java (which, by the way, wasn’t a very developer-friendly one) and the software built with it will be as good as the developer team. so don’t worry at all… if you’ve done nice applications with java now you got a way to make the new ones even better. just drop your prejudices and embrace the new wave |
zahi