News for hackers. Stuff that matters.
Re:The rise and rise of JSON (2017) by gaius on Friday August 24, 2018 @03:35AM (#17833404)
Ah, Groovy. All the brevity of Java and all the type safety of JavaScript. I had no idea anyone still used it, let alone loved it!
Re:The rise and rise of JSON (2017) by rhencke on Friday August 24, 2018 @07:15AM (#17834189)
That's an unfortunate stance on Groovy. Groovy code is often far more brief than Java's, and it has some beautifully expressive capability for making DSLs, both through its world-view on closures and its ability for the developer to walk and modify the AST at compile time (see, for example, the @Canonical attribute for how this can be useful)

While I, too, wish it built on a statically typed base, Groovy offers amenities such as @CompileStatic that go a long way towards alleviating this.

I personally find Kotlin strikes a wonderful spot with the brevity and expressiveness of Groovy, while managing to be more type-safe than Java (reified generics, null safety in the type system). But there is no denying Groovy's heavy influence on Kotlin, either.

Groovy may not be perfect but I don't think the picture you paint is accurate, either.

Re:The rise and rise of JSON (2017) by vorg on Friday August 24, 2018 @08:01AM (#17834357)
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.

Re:The rise and rise of JSON (2017) by Zardoz84 on Sunday August 26, 2018 @08:49AM (#17845708)
I use Groovy with Spock to write unit tests. Wonderful way to write tests.
Re:The rise and rise of JSON (2017) by zmmmmm on Friday August 24, 2018 @03:55AM (#17833492)
Pretty much wrong on all counts - doesn't sound like you know very much about groovy at all?
Re:The rise and rise of JSON (2017) by gaius on Friday August 24, 2018 @03:58AM (#17833497)
Have unfortunately had to use it as it was the scripting language embedded in an application we used. Now I avoid it whenever possible. Even BeanShell was better!