I do a lot of research on template engines. The most concise and powerful one is the Groovy template engine, but we finally chose to use regular Java as the template engine because:
Good IDE support: Though IntelliJ IDEA supports Groovy, but it doesn't support Groovy template, so users need to write Groovy template as the pure text, which is a painful user development experience, especially Groovy template lacks complete documentation.
Strongly typed language: Though Groovy template can be considered a typed language, IntelliJ IDEA cannot even recognize it, so users still need to code as if they are pure text files, which is painful.
For Java templates, we can define some interfaces/contracts for users to implement, so the template will be quite clear.
Best performance: Groovy templates are compiled to class files at runtime, but output code quality is not as good as Eclipse Compiler that we use to compile Java templates at runtime.
Powerful: Support expressions as many as possible. Both are powerful enough because they can call any Java methods/fields whatever in templates.
Easy for users to learn: Most users are Java developers, they don't need to learn the "template language" if we choose Java as the template language.
Concise: Groovy template wins.
Runtime dependencies should be as small as possible:
btw, we don't want FreeMarker because: 1. It lacks maintenance; 2. Legacy syntax design, especially compared to Groovy template; 3. Bad performance. It should be rewritten to use ASM/ClassFile API to compile templates to class files.
I do a lot of research on template engines. The most concise and powerful one is the Groovy template engine, but we finally chose to use regular Java as the template engine because:
Eclipse Compiler
that we use to compile Java templates at runtime.btw, we don't want
FreeMarker
because: 1. It lacks maintenance; 2. Legacy syntax design, especially compared to Groovy template; 3. Bad performance. It should be rewritten to use ASM/ClassFile API to compile templates to class files.