7.
Command chains• A grammar improvement allowing you to drop dots & parens when chaining method calls • an extended version of top-level statements like println• Less dots, less parens allow you to •write more readable business rules •in almost plain English sentences • (or any language, of course) 6

31.
GPars bundled• GPars is bundled in the Groovy distribution• GPars covers a wide range of parallel and concurrent paradigms •actors, fork/join, map/ﬁlter/reduce, dataﬂow, agents •parallel arrays, executors, STM, and more...• And you can use it from plain Java as well! 10

57.
Controlling code execution• Your application may run user’s code •what if the code runs in inﬁnite loops or for too long? •what if the code consumes too many resources?• 3 new transforms at your rescue •@ThreadInterrupt: adds Thread#isInterrupted checks so your executing thread stops when interrupted •@TimedInterrupt: adds checks in method and closure bodies to verify it’s run longer than expected •@ConditionalInterrupt: adds checks with your own conditional logic to break out from the user code 20

66.
Compilation customizers• Ability to apply some customization to the Groovy compilation process• Three available customizers •ImportCustomizer •ASTTransformationCustomizer •SecureASTCustomizer• But you can implement your own 27

79.
Underscore in literals• Now we can also add underscores in number literals for more readability long creditCardNumber = 1234_5678_9012_3456L long socialSecurityNumbers = 999_99_9999L float monetaryAmount = 12_345_132.12 long hexBytes = 0xFF_EC_DE_5E long hexWords = 0xFFEC_DE5E long maxLong = 0x7fff_ffff_ffff_ffffL long alsoMaxLong = 9_223_372_036_854_775_807L long bytes = 0b11010010_01101001_10010100_10010010 39

81.
InvokeDynamic• Groovy 2.0 supports JDK 7’s invokeDynamic • compiler has a ﬂag for compiling against JDK 7 • might use the invokeDynamic backport for < JDK 7• Beneﬁts • more runtime performance! • at least as fast as current «dynamic» Groovy •in the long run, will allow us to get rid of code! • call site caching, thanks to MethodHandles • metaclass registry, thanks to ClassValues • will let the JIT inline calls more easily 41

112.
Static Compilation• Given your Groovy code can be type checked... we can as well compile it «statically» • ie. generate the same byte code as javac• Also interesting for those stuck in JDK < 7 to beneﬁt from performance improvements 57