birth to Groovy: a dynamic and agile scripting language for the JVM. […] James always used to say that it was all Bob's fault, but indeed, James had so many groovy ideas that it's hard to believe it's not his own fault. He kept saying: "Wouldn't it be groovy if we could do this and that...". Hence the name "Groovy". That's roughly how it all started.
1.4+ • All the nice shortcuts already, inspired by Python & Ruby • native syntax for lists, maps, etc… • Tons of useful methods to simplify common Java boiler-plate code • Initially dynamically-typed only
• by Alex Tkachman (former G2One co-founder) • Big focus on static compilation • interesting playground for our forthcoming static type checking and static compilation support
Multiple assignments • Optional return in if/else, try/catch, switch/case • More AST transformations • @Singleton, @Lazy, @Immutable, @Delegate • The Grape module system with @Grab • OSGi support
static classes • Missing annotation definition support • Power Asserts from Spock • Customize the Groovy Truth! • AST viewer and AST builder • SQL support improvements
with the Groovy distribution • Primitive calculation optimizations • Closures • as annotation parameters • currying, memoization and tail recursion • Built-in JSON support
• type inference, flow typing… • « Project Coin » enhancements • binary literals, underscore in numbers, multicatch block • Initial « invoke dynamic » support • Modularity of the Groovy code base with modules
• Drastic performance improvement for JSON • New AST transformations & improvements • @Builder,@Sortable,@SourceURI, @BaseScript • New markup template engine • More NIO support
• cheaper comparison operations • optimization of primitive type coercions with ‘as’ • Reduced bytecode size • no MOP generated methods in static context • uneeded inner class distributor methods when no inner • timestamp removal • Reduced memory consumption
System.currentTimeSeconds() • List: removeAt(index), getIndices() • Collection: removeElement(Object) • Iterable: disjoin(), size(), dropRight(), takeRight() • More collection methods moved to iterator-based • Favor stream-like traversal methods leveraging iterables • Consistency for mutation in place vs new collection creation
parameter • Can define compilation phase for @ASTTest • @Synchronized supports explicit static locks used by instance methods if needed • Cleaned-up code for @AutoExternalizable and @EqualsAndHashCode when used with @CompileStatic • Improved Java integration for @Builder • @PackageScope allowed on constructors
.profile scripts • instanceof completion • Static members completion only in a static context • Completion candidates in color • :set interpreterMode to remember locally-defined variables • :load command supports file names with spaces • Align arguments & flags with the groovy command • Script launch on startup & continue execution of Groovysh • Easier to subclass Groovysh for embedded reuse
Mailing-lists • JIRA • Sources moved to Apache’s Git • with a mirror on Github • Still need to see what we do with the groovy-lang.org website Please Star it!
with an ASM class reader • @Canonical becomes a meta-annotation • More control on the meta-annotation collector • New @MapConstructor transformation • Property validation in transformation parameters • Further AST transformation improvements
true) class Person { String name int age } assert new Person('Guillaume', 38).toString() == 'Person(name:Guillaume, age:38)' includeNames from @ToString
annotation collection will always be inserted. PREFER_COLLECTOR Annotations from the collector will be added and any existing annotations with the same name will be removed. PREFER_EXPLICIT Annotations from the collector will be ignored if any existing annotations with the same name are found. PREFER_EXPLICIT_MERGED Annotations from the collector will be ignored if any existing annotations with the same name are found but any new parameters on the collector annotation will be added to existing annotations. PREFER_COLLECTOR_MERGED Annotations from the collector will be added and any existing annotations with the same name will be removed but any new parameters found within existing annotations will be merged into the added annotation.
= 'sirName') class Person { String firstName String surName } new Person(firstName: "John", surName: "Doe").clone() Error during @AutoClone processing: 'excludes' property 'sirName' does not exist.
class Person { String name } @Immutable @TupleConstructor(includeSuperProperties = true) @EqualsAndHashCode(callSuper = true) @ToString(includeNames = true, includeSuperProperties = true) class Athlete extends Person { String sport }