Manifold[2] is basically a javac plugin if I'm not mistaken, and it shows just how powerful stuff can be accomplished with this approach (including e.g. auto-generation of Java types from common modelling languages like GraphQL, JSON, YAML etc. adds extension methods, unit expressions, ranges, C++-like preprocessors, structural subtyping, even crazy stuff like type-safe reflection - like Ceylon used to have!).
For Groovy, besides the built-in AST annotations like `@Immutable` and `@Canonical` (which turns a class into a data class, basically), you can achieve stuff like the Spock Testing Framework[3] which changes the Groovy syntax a little bit to make it really awesome for testing.
[0] https://www.baeldung.com/java-build-compiler-plugin
[1] https://groovy-lang.org/metaprogramming.html
[3] https://spockframework.org/spock/docs/1.0/spock_primer.html