4 ms·
Groovy is amazing. It's like javascript and Java had a beautiful baby that lets you compile either dynamically or statically.
by humbleMouse 10y ago
Groovy is amazing. It's like javascript and Java had a beautiful baby that lets you compile either dynamically or statically.
- vorg 10y agoThe static compilation doesn't quite work properly. Groovy is good for scripting though, similar to the way Bash is used in Linux, so test your Java classes with it, or use it as a DSL in Gradle builds. For building systems on the JVM, use a language designed for that purpose from the ground up, e.g. Java, Scala, or Kotlin.
- humbleMouse 10y agoIt works quite well in the 1.5 million code line application written in groovy that I work on. I am sure Scala and Kotlin are nice languages, but groovy static compilation seems to work great in my experience.
- vorg 10y ago> the 1.5 million code line application written in groovy That's quite big for Groovy. There's a lot of exaggerated claims coming out of that ecosystem. Most JVM apps that size are actually written in Java, perhaps with the codebase duplicated a few times, and counting testing copies of the code in the LOC count. If the harness for testing is written in Groovy, you could call it a "1.5 million line Groovy app". If some of that Java code is compiled or run as Groovy code in some testing framework, you could call it all "Groovy code". If the Groovy code is called from some app written in Java, such as Grails, you could get creative and call it a "Groovy application". > groovy static compilation seems to work great And just what proportion of that Groovy code is really compiled statically and run in a production app?
- humbleMouse 10y agoTo be fair - only about 2/3 of the code in the app I mentioned is written in groovy. We strictly enforce static compilation with all of our groovy files. The app is used daily by 35,000 users concurrently @peak time.
- vorg 10y agoMy last personal experience of programming in Apache Groovy was with version 1.8. Often I tried recompiling some Java code from Groovy's codebase into Groovy, and even after changing it to allow for occasionally different semantics, it wouldn't work. It could be that Groovy 2.4 has improved a lot since v 1.8, but with the history of exaggerated claims associated with Groovy's backers, I'd need more evidence for your claim. For example, if the next version of Groovy ships having translated its own codebase into statically compiled Groovy, I'll happily look at it again for building systems. In the meantime, I'll only trust it for scripting. Then there's their governance problem -- nowadays, a single person owns the groovy-lang.org website, whereas until early last year it was governed by 5 "despots" at Codehaus. It's never good when leadership becomes less consensual.
- olavgg 10y agoI also have several big projects with hundreds of thousand lines of Groovy code that works fantastically well. And performance is top notch!
- vorg 10y agoApache Groovy is a dynamically typed language so performance can't be "top notch". And the static compilation is an addon that only works when used sparsely. If it worked at scale, the Groovy codebase itself would have been translated into statically compiled Groovy, but that's not happening because Groovy's static compilation doesn't scale. Groovy's good for scripting, nothing more, which isn't a bad thing. Just use it to script/test systems built with Java (or Scala or Kotlin or whatever).