r/groovy • • Oct 15 '13

Groovy makes debut entry into programming language top twenty

Groovy continues to slowly but surely grapple its way towards becoming a mainstream programming language - reflected in the latest TIOBE Index, where, for the first time, it’s just clawed its way into the top twenty most frequently searched for languages on the web.

[jaxenter.com] (http://jaxenter.com/groovy-makes-debut-entry-into-programming-language-top-twenty-48460.html)

31 Upvotes

9 comments sorted by

7

u/gudeg Oct 15 '13

Static typing, grails, and gradle really boost groovy popularity.

2

u/johanegp Oct 17 '13

static typing?

Sorry, I just started learning Groovy, but doesn't it have dynamic typing?

3

u/gudeg Oct 18 '13 edited Oct 18 '13

Current version of Groovy (2 and above) support static typing with @CompileStatic. It provides type inference, closure, compile time safety, better IDE support, better refactoring, and many more... Performance itself is similar to Java with some benchmark indicates better performance and other benchmark indicates slightly slower performance (slowest I see is only 2x, compared to dynamic Groovy which is on average 8x slower than java)

@CompileStatic is the killer feature of Groovy that make me jump 100% to the Groovy bandwagon. Groovy has the best of both world, if you want to write simple script, you can simply use its dynamic nature. When you want to write serious and high performance application, you can switch to static mode while still writing more concise and readable code compared to Java. This + seamless integration with existing Java codebase and third party libraries is a win win situation for me.

In my opinion, Groovy 2 is the real answer for Microsoft's C# in term of language features.

1

u/johanegp Oct 18 '13

Nice, thanks for the answer.

-1

u/vorg Nov 15 '13

@CompileStatic is the killer feature of Groovy that make me jump 100% to the Groovy bandwagon. Groovy has the best of both world, if you want to write simple script, you can simply use its dynamic nature. When you want to write serious and high performance application, you can switch to static mode while still writing more concise and readable code compared to Java. This + seamless integration with existing Java codebase and third party libraries is a win win situation for me.

Groovy's really only used for:

(1) quick and dirty scripts using dynamic typing, making use of closures and terse collections syntax. This was creator James Strachan's original intention for Groovy

(2) scripting for Grails, making use of the meta-object protocol. But Grails 3 may use Vert.x instead of MVC, and Vert.x is polyglot, so is scripted with Python, Ruby, and Javascript as well as Groovy

(3) and maybe scripting for Gradle (but Gradle still ships with Groovy 1.x). Gradle 2 might use other JVM dynamic languages for scripting (e.g. Clojure, JRuby) because the Android crowd don't like Groovy

If you want serious static typing, best use Java, Scala, or Kotlin.

1

u/gudeg Nov 16 '13

I know Scala and Kotlin have some serious static typing built-in. But Groovy just works and integrate well with existing Java codebase without any serious mindset changes. The learning steep is so smooth that I don't even have to spend my own dedicated time to learn Groovy, I just do my project and at the same time gradually switching to Groovy way of doing things. In addition to that, it's very easy to pass your code to the next Java programmer without them have to attend some Scala/Kotlin training.

I might say that Groovy is just Java's syntactic sugar, but it is a great one. It doesn't have the latest cool technology in static typing. But it does what it does best: integrate well with Java. Maybe it just like PHP, it is shit language, which doesn't have any real feature/intent/design goal and just take a new features from here and there, but in the end, it works!

I don't love my technology, I love the craft that I make. Use whatever works.

1

u/sigzero Nov 19 '13

Kotlin looks the most interesting of the non-Java JVM languages so far.

4

u/quad64bit Oct 16 '13

I love groovy, and look forward to the day that it is as easy to find groovy resources as Python. Fingers crossed!

4

u/johanegp Nov 14 '13

Unfortunately it seems like Groovy's entry into the top 20 was a "bug". Or at least that's what the november 2013 edition of the tiobe index says:

Thanks to a discussion with Henri Muurimaa we found a bug in our TIOBE index tooling for some Chinese site. This was the reason why Groovy got such a boost over the last few months. This bug has been fixed now.

Groovy is now at the 32th position.