See http://groovy.codehaus.org/ '''Introduction''' Groovy * is a powerful new high level dynamic language for the JVM combining lots of great features from languages like Python, Ruby and Smalltalk and making them available to the Java developers using a Java-like syntax. * is designed to help you get things done on the Java platform in a quicker, more concise and fun way - bringing the power of Python and Ruby inside the Java platform. * can be used as an alternative compiler to javac to generate standard Java bytecode to be used by any Java project or it can be used dynamically as an alternative language such as for writing scripts or unit test cases. * has Features ** Closure support ** Native syntax for Lists and Maps ** Groovy Markup ** Groovy Path expression language ** Groovlets for implementing Servlets easily in simple Groovy scripts ** Groovy SQL for making SQL more Groovy ** Ant Scripting ** Regex syntax for neater scripting with regular expressions ** Groovy Beans for simpler syntax for working with beans ** Operator Overloading to simplify working with datatypes Collections and Maps ** Polymorphic iteration and Autoboxing ** Compiles straight to Java bytecode & works cleanly with all existing Java objects & libraries '''Example''' class Foo { def doSomething() { def data = ["name": "James", "location": "London"] data.each { key, value -> println("entry $key is ${value.length()} characters long") } } def closureExample(collection) { collection.each { println("value $it") } } static void main(args) { def values = [1, 2, 3, "abc"] def foo = new Foo() foo.closureExample(values) foo.doSomething() } } ---- '''Discussion''' What does everyone think of this language, (apart from the name being um. ... an interesting choice ;) Not to sound cliche but if it's stable and does what it claims while still remaining clean and orthogonal I think it's rather groovy. ---- Its interesting that Groovy appears to meet all the criteria listed on the ScriptingLanguage page (unlike Java) which I guess is a good thing; having a powerful scripting engine that can be used inside Java is very useful. Folks can use things like JavaPython, JayRuby, Rhino, BeanShell - though Groovy is designed to be a neat scripting language in the Ruby-ish mold which interacts natively with Java without a syntactic, semantic or implementation mapping layer. i.e. groovy classes are just java classes, groovy classes often derive from java.lang.Object, you can create classes in groovy that can be called by Java and vice versa; you can overload methods using Java method overloading rules (i.e. method name and parameter types) and implement Java interfaces etc. ---- I'm watching this language, since it seems to have some of the core features of Ruby without the annoying perlisms ($-variables, statement modifiers), plus some cool features. The documentation for Groovy hasn't really arrived yet, so for me, the jury is still out. I still don't understand how precisely the two languages are similar and different; e.g. I get the vague impression that Groovy is not as dynamic as Ruby is. Groovy has access to the mass of Java libraries, however, Groovy dynamically extends Java's built-in collections, arrays, and Strings with closure-friendly features. So it essentially makes the JDK a lot more scripting-friendly. See http://groovy.codehaus.org/quickStart.html for examples. ---- CategoryProgrammingLanguage