Jeremy Hylton : weblog : 2003-12-01

"Groovy" Language

Monday, December 01, 2003

Seen on the ll1 list: Groovy is consise & powerful dynamically typed OO language for the JVM. . Python benefits a lot from having good builtin datatypes. If Java just added those, how much better would it be?

We want a great high level scripting language thats designed specifically for the JVM. Ruby, Python & Dylan are cool & are their own platform with their own APIs and conventions. We want a scripting language that builds on the JDK and all the Java conventions & tools, but just adds the nice high level language features of static and/or dynamic typing, closures, native syntax for maps, lists, beans, events, markup, XPath etc.

One of the examples from the wiki looks like the kind of Java code I would probably write if I tried to program in Java (except that I wouldn't use a list to store a heterogeneous collection).

class MyTest extends GroovyTestCase {
    private foo = new Foo()

    void testFoo() throws Exception {
        map = ['foo':'abc', 'bar':123, 'xyz':'edam']
        list = [1.23, 1234, 'hello']
        foo.doSomething(map, list);    

I wonder what the future of scripting languages for Java is. Jython is a good choice, but it isn't a trivial migration from Java to Python, and the developer community is too small. A Groovy-like language has a smaller migraton path, but it's another new language. How good does a new language need to be to gain traction?