Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Last active December 14, 2015 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mike-neck/5114818 to your computer and use it in GitHub Desktop.
Save mike-neck/5114818 to your computer and use it in GitHub Desktop.
/**
* GroovyASTTransformation の お話
*
* {@see http://groovy.codehaus.org/Compile-time+Metaprogramming+-+AST+Transformations}
* Groovyの言語仕様を拡張せずに、Groovyの機能を拡張しましょうということ。
* Groovy scriptとかGroovy codeは Groovy Compiler によって中間的にAbstract Syntax Tree (抽象構文木)の形でメモリーに保存される。
* AST Transformation では コンパイルされたコードが JVM のバイトコードになる前に、AST をいじってコードを修正・変更可能にする。
*
* AST Transformations provides Groovy with improved compile-time metaprogramming capabilities allowing powerful
* flexibility at the language level, without a runtime performance penalty.
*
* AST Transformation によって Groovy はコンパイル時にメタプログラミングを実行することが可能になるだけでなく、
* runtime のメタプログラミングによる実行速度の低下を避ける事もできるようになる。
**/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment