Apache Groovy's Metaprogramming Options and You
summary
Three new Groovy releases land (3.0.7, 2.5.14, 2.4.21) and Groovy 4 changes package namespaces, breaking binary compatibility. Runtime metaprogramming uses MetaClass MOP to add methods, plus methodMissing/propertyMissing, categories, mixins, traits and extension modules that are IDE-aware and type-checked. Compile-time uses AST transformations (local and global), with ~70 built-ins like ToString, Canonical, Immutable and a Pojo prototype that emits plain JVM bytecode; macro methods and ASTBuilder generate code programmatically.
AI-written summary · about
chapters (15)
- 0:00Introduction to Groovy
- 1:31What is metaprogramming
- 2:55Runtime metaprogramming basics
- 7:09Method missing in Groovy
- 9:18Categories and mixins
- 12:52Traits in Groovy
- 14:17Extension modules
- 18:06Compile-time metaprogramming
- 19:52AST transformations
- 23:46Canonical transformation
- 24:50Immutable classes in Groovy
- 26:14Groovy and Project Lombok
- 28:00Global AST transformations
- 29:03Macro methods
- 30:26Resources and contributions
related talks
01h 29mRuntime Metaprogramming With Groovy
56mMetaprogramming With The Groovy Runtime - Part 1 of 2
52mGroovy MOPping
40mGroovy update: What's new in Groovy 3 and coming in 4
57mGroovy 3: All The Major New Features
01h 27mGroovy, in the light of Java 8
01h 01mPolyglot Programming in the JVM
46mGroovy - The Art of Calling Methods
