ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Groovy, Java's New Scripting Language
Subject:   your comparison unfavourable on 'competition'
Date:   2004-10-11 02:05:22
From:   davidccrane
I'll have to take you up on the comparison you made between groovy and orher java scripting languages, Ian, as I don't see any of the key selling points as being unique to groovy.


special syntax
Beanshell must have the least special syntax of them all, as it's possible to interpret most java code directly via beanshell, including support for inner classes, allegedly (haven't tried this one myself, I admit). Admittedly, some languages such as python will look different at first


exposing bean-like properties directly
jython can do this, and also applies a similar 'shortcut' syntax to event listeners, making gui coding very concise, on a par with your swingbuilder example's actionPerformed syntax


optional semi-colons
a well-known feature of javacript


pre-compiling scripts into bytecode
both jython and rhino have had this capability for some time. Like groovy, both require bundling of the scripting runtime at deploy-time, but performance increases are improved


closures
ruby supports these (I don'tr know jruby, so can't comment any further)


servlets
would the BSF scriptlet tag be worth a mention here, as it allows just about all the other scripting languages mentioned be easily embedded into JSP's?


standards
Javascript is an ECMA-standardised language, and rhino adheres to the standard. Beanshell follows the java language standard. Python is on weakest ground here, with C-python being both implementation and standard before jython came along. There is relatively little jython-specific docs on the web, but the python docs are comprehensive and largely applicable. For those who need more hand-holding, here are a couple of books.



I've nothing against groovy, and a great deal of support for jvm scripting languages of all flavours. As the new kid on the scripting block, I've heard a lot about groovy, but didn't find your article provided me with a compelling reason to switch away from jython, beanshell or rhino.


Thanks for writing,


Dave


1 to 1 of 1
  1. Ian F. Darwin photo your comparison unfavourable on 'competition'
    2004-10-23 08:56:52  Ian F. Darwin | O'Reilly Author [View]

1 to 1 of 1