Runtime and Compile-time Metaprogramming in Groovy

Опубликовано: 28 Сентябрь 2024
на канале: Developer Summit
292
0

Speaker: Scott Davis

Groovy is a dynamic language that runs on the JVM. But what does "dynamic" really mean? In this talk, we'll explore what is it means to be a dynamic programming language. We'll see how Groovy adds new methods to existing Java classes -- even final classes like java.lang.String.

Like any powerful language feature, there is more than one way to metaprogram new methods and fields onto existing classes. You might decide to do it in a transient fashion at runtime, or in a more permanent way by transforming the bytecode of the compiled class. We'll discuss the pros and cons of both approaches, with lots of live coding examples.