Blogging Roller

Dave Johnson on open web technologies, social software and Java

Doesn't anybody have anything bad to say about Groovy?

I certainly don't. Groovy is fascinating, fun to play with, and, for a Java developer, much easier to grok than Jython. I've already written a couple of simple Groovy SQL scripts and now I'm trying to wrap my mind around Groovy Markup. What a cool new toy!

Later... Here is one small nit. Groovy could use better error reporting. When an error occurs, you don't always know what line in the script caused the problem.

Comments:

Performance could be much better in some cases:

class A{
counter=0
foo()
{
this.counter++
return this.counter
}
}
class B extends A {
}
class SampleMain {
static void main(args) {
obj= new B()
start = System.currentTimeMillis();
for ( i in 0..10000000 ) {
obj.foo()
}
end = System.currentTimeMillis();
print( end - start );
}
}
Sorry for the formatting ...

Takes much longer then in other scripting languages.

Regards, Markus

Posted by Unknown on December 19, 2003 at 06:11 AM EST #

Absolyutely. We've not even started yet optimising the bytecode. Especially dynamic method dispatch - that could be optimised massively.

Then even though at compile time we can deduce some static method invocations (to create neater, faster bytecode) we're not doing that - so all methods are dispatched using the dynamic dispatch.

I suspect Groovy can get *way* faster than it is today by several degrees of magnitude.

Posted by James Strachan on December 19, 2003 at 07:30 AM EST #

Yeah I have several: (1) I'll have to learn another !"£$%^ language (2) As a Perl monger for too many years, I hate scripting languages (3) It's far too complex already, with integration with XML, SQL, etc etc. Oh wait, none of those are good reasons :)

Posted by Pratik Patel on December 19, 2003 at 08:57 AM EST #

Err, if you remove the people who are entertained for hours by dangling shiny objects, one question remains: What's the point?

Posted by Hani Suleiman on December 19, 2003 at 12:58 PM EST #

Pratik, in response to your 3 points:
1) Groovy is so similar to Java you don't have to learn much at all
2) Simple interpreter-friendly scripting languages have their place the Java world
3) Groovy is designed to be simple not complex and from what I've seen, the design is successful

Posted by Dave Johnson on December 19, 2003 at 01:41 PM EST #

Er...okay. The name sucks. Having a file ending .groovy sucks. Um, let me count the ways of how many other scripting languages there are for Java. But they built it, so people will come.

Posted by Unknown on December 21, 2003 at 03:31 PM EST #

Post a Comment:
  • HTML Syntax: Allowed