4 ms·
If you need to use the JVM ... > walk and modify the AST at compile time Clojure is best for this. A macro only a few lines long in Clojure will do the same a
by vorg 8y ago
If you need to use the JVM ...
> walk and modify the AST at compile time
Clojure is best for this. A macro only a few lines long in Clojure will do the same as what a few hundred lines in Apache Groovy are required for. It's possible to walk the AST in Groovy but it's verbose and messy.
> CompileStatic that go a long way
Both Kotlin and Scala are both statically typed from the ground up, instead of having a @CompileStatic annotation tacked on later.
> the brevity and expressiveness of Groovy
Groovy started off in 2003 as a functionally similar clone of Beanshell, which had already existed since 1999, but with closures added. Someone then translated all the standard functional methods from Ruby into Groovy's codebase. Of course, Jython, a JVM version of Python, has been around since 1997. So Groovy is a relative late comer to the JVM in this regard.
Groovy tried to be a bit of everything for everyone on the JVM, but has ended up being used only for 20-line build scripts in Gradle.