30

I am sure this question has been asked many times. However, I like to ask it again with the intention of what is the future of these languages.

I was first introduced to Groovy and really liked it. I felt the syntax was simpler and it was much closer to Java and I was able to quickly learn Grails.

Then there was Scala, and the web frame work Lift. I am still learning Scala and I find the syntax very difficult at times.

However, I still wonder what is the future of Groovy. When the author of Groovy says he would have never created groovy if he knew about Scala, then it makes me wonder if there is a future at all. Of course Groovy has came a long way and Grails is used today by many large companies.

If one was to look at Grails vs Lift today, then Grails would be clear winner. More companies are using it. But given everything I have said so far, I am interested to know if one should invest in Groovy? Is Groovy going away and Scala the better choice? If the CEO of BMW says he drives a Mercedes then one would wonder why shouldn't we all drive Mercedes too, right?

(I understand if this question is really broad and might be closed. I hope to make it an open Wiki for others though.)

Chiron
  • 4,553

5 Answers5

23

I don't think Groovy is going to disappear, it is a self sustained entity now. Grails framework is built around Groovy language, which it is a good reason to stay alive. Groovy got its killer application.

I'm not saying Grails is the only vital Groovy project, Gradle is also pretty good. GORM is really handy. Gant is a nice improvement over Ant.

Not mention that Groovy/Grails are now under the umbrella of SpringSource and they are committed to the both.

If the CEO of BMW says he drives a Mercedes then one would wonder why shouldn't we all drive Mercedes too, right?

Guess what James Gosling chose?

Chiron
  • 4,553
5

As well as @The Legend of 1982's comments:

Groovy will continue to stick around as it's the dynamic alternative to Java with syntax that is close enough to Java to allow many developers to make the switch (or at least dabble in it).

  • Grails is constantly in the top 2 frameworks whenever Matt Raible does his massive JVM language web framework comparison charts/analysis. His is probably the most complete analysis out there.

  • GPars is a new concurrency lib/API which brings Groovy very much up Scala's capabilities there.

The issue with speed will improve over time as Groovy figures out how to use invokedynamic and other compiler tricks.

3

Groovy is a very nice and underestimated (even by it's own creator, as you've mentioned) language. As for me, it's role in Java ecosystem is like Lua's role in C/C++ world ecosystem. Yes, it's not that fast but nevertheless.

I'll be very sad if groovy will die, but this roadmap actually tells us that it's not that bad.

Actually, Groovy is very nice, neat, expressive language. As for Scala, I believe that Groovy and Scala are just in different niches.

shabunc
  • 2,454
3

Not to knock the general excellence of Groovy or indeed Ruby, but, over 90% of web traffic is to sites written in PHP or some Java framwork.

I don't know where you got the "Grails is used by many large companies" this is pretty much like saying "all the fortune 500 companies use Python" which is actually true, but, they do not use python for anything business critical.

They are right not to use Grails, Rails etc. they are great for small neat sites, but, they do not scale well. Also most large businesses have intricately inter-connected systems, and the major challenge when building web applications revolve around how to connect to all the other systems which provide or consume your data -- coding by convention just does not work in this space.

Groovy the language's main competitor is actually JPython which operates in the sames space (Scripting on a JVM) and is used for the same sort of things (Automated tests, automated builds etc,).

2

The performance of Groovy 2.0 puts Groovy now into a league very close to Java, see http://java.dzone.com/articles/groovy-20-performance-compared The benchmark in this article is very very rough, but I'm working now on a new benchmark for Groovy 2.1 based on the one by Robert Hundt (https://days2011.scala-lang.org/sites/days2011/files/ws3-1-Hundt.pdf) made to compare performance of Google Go with other languages. I need 2-3 weeks till I'm done with writing the article, but the measurements look very good so far. Groovy2.1 with @CompileStatic and JDK7 has about the same performance as Java with JDK6 (!).

I think Groovy will compete more with Kotlin and maybe Ceylon rather than with Scala. Scala is more an academic research language (albeit a very interesting one) and not that much a language to get work done as Groovy and Kotlin. If you are simply missing mixins, extension methods, true closures and things in Java it is a big step you have to make for just getting this. The syntax of Groovy is very close to Java which think is a real selling point compared to Kotlin.

OlliP
  • 275
  • 2
  • 2