ECMAScript is our Groovy alternative

12 AM December 17, 2004

While Groovy gets its act together, the Rhino Javascript/ECMAScript interpreter seems a reasonable alternative in some situations.

For example, the project I’m working on requires that the IT department be able to change certain business rules while the application is running. A bespoke administration interface would cost too much, and a rules engine would be too complex. Letting the user specify the rules in a Groovy might have been a good choice, but Groovy is just not ready to be used in a system that will still be maintained in ten year’s time.

Enter Javascript. It has a C-inspired syntax that Java programmers feel comfortable with, it can be loaded and re-interpreted each time the rules change, and is quite well integrated with Java. A perfect replacement for groovy in this case.

Beyond tiny, user-written scripts, Javascript has many of the features that make Groovy attractive, including latent typing and closures. Javascript also has a sophisticated, prototype-based object model that could be used to develop the kind of code that is particularly hairy in Java – marshalling and unmarshalling streams of bytes, for instance.

So it’s Javascript for the time being for us here. Hopefully, in twelve or eighteen months, Groovy will hava a solid specification and a production ready implementation, and we’ll switch.

By alang | # | Comments (3)
(Posted to javablogs and Java)

Comments

At 01:09, 18 Dec 2004 Aslak Hellesoy wrote:

[Java|ECMA]script is much more than that - it is a really powerful prototype based language:

http://www.crockford.com/javascript/survey.html
http://c2.com/cgi/wiki?PrototypeBasedProgramming

(#)
At 18:57, 09 Jan 2005 jenny wrote:

ecmascript is much better than groovy. (FULL STOP)
but what we need is not the proliferation of hundreds of scripting languages to interact with java but a framework to gain from their sinergy.
welcome to seppia. http://www.seppia.org/

<a href="http://www.seppia.org">
Seppia is a simple framework to build and deploy any java application which combines java and javascript in unique way.
</a>

(#)
At 21:48, 16 Jan 2005 Justin Pookoo wrote:

The power of java and javascript to build modular applications

http://www.seppia.org/

(#)

Add Comment




(Not displayed)






(Leave blank line between paragraphs. URLs converted to links. HTML stripped. Indented source code will be formatted with <pre> tags.)




© 2003-2006 Alan Green