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,543
  • 3
  • 28
  • 37
Amir Raminfar
  • 402
  • 1
  • 4
  • 8
  • 1
    _If one was to look at Grails vs Lift today, then Grails would be clear winner._ Says who? – Mahmoud Hossam Aug 18 '11 at 02:34
  • I was just doing by popularity. Grails has x1000 followers and Lift has only x200ish on stackoverflow. – Amir Raminfar Aug 18 '11 at 02:40
  • Maybe lift is easier? has better documentation? or maybe Grails has been around for longer than lift? – Mahmoud Hossam Aug 18 '11 at 03:35
  • 3
    It would be more fair to compare Grails with Scala + Play Framework. Play Framework can also be used with Java and is inspired by Ruby on Rails. – Jonas Aug 18 '11 at 07:58
  • 4
    _"If one was to look at Grails vs Lift today, then Grails would be clear winner"_, you said 2 yrs ago, but Play! 2 has easily supplanted Lift as the leading Scala-based web framework, and is streets ahead of Grails (IMHO). – Vorg van Geir Apr 03 '13 at 14:14
  • I think it should go away because it has no good reason to stay. – nomadSK25 Dec 23 '20 at 03:04

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,543
  • 3
  • 28
  • 37
  • Gradle is no more open source !_! – Ant's Nov 19 '11 at 07:22
  • 1
    What truly matters is the core language and it's core libraries. You can't make anything better than Groovy. The core language is easy and dynamic, it's fast, and the java libraries like apache etc are better than in other languages. It's the best language around and because of that it is not going away. Plugins and Grails is not what matters - the world of dynamic languages like PHP knows already what matters (just like I said). And there's tomcat and jboss. Now go and check Ruby, it's a joke! It's worse than .net! Now go and check Python and figure out how to handle errors in network code. – Andrew Smith Sep 25 '14 at 11:51
  • You're right.. Gradle is becoming more popular which uses Groovy scripts.. – The Coder Sep 27 '15 at 15:36
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.

Martijn Verburg
  • 22,006
  • 1
  • 49
  • 81
  • _"Grails is constantly in the top 2 frameworks"_ but PHP-based backends aren't considered to be a "framework", even tho that's what the vast majority of businesses still use. – Vorg van Geir Apr 03 '13 at 14:11
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,424
  • 2
  • 20
  • 27
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,).

James Anderson
  • 18,049
  • 1
  • 42
  • 72
  • 1
    Looking around, nobody I know uses Groovy these days and there aren't any Groovy job listings being advertised in my area. So, sure doesn't look good for it. I'm sure it's in use, but it's not a mainstream technology around here. – Brian Knoblauch Jan 25 '13 at 13:19
  • 1
    @Brian Groovy's still the only feasible choice if you need to use Grails. _(Tho admittedly Grails is increasingly being supplanted by cleaner upcomers such as Play! 2.)_ – Vorg van Geir Apr 03 '13 at 14:07
  • @James Don't forget Eclipse as a Groovy-killer for JVM scripting, automated tests & builds, etc. – Vorg van Geir Apr 03 '13 at 14:09
  • I've run across a local shop using Groovy now! However, I've still yet to meet anyone that uses Grails. – Brian Knoblauch Apr 03 '13 at 14:44
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
  • 4
    I beg to disagree about Scala being academic. It is actually very productive and helpful, and currently in use in many financial institutions, on Linkedin, Twitter and so on. I actually tried both Scala and Groovy here where I work, and I would never choose Groovy for projects over a mild threshold of complexity. – Andrea Jan 25 '13 at 10:12
  • 1
    Just last week [a serious bug in Groovy 2.1 statically-compiled mode](http://groovy.329449.n5.nabble.com/BUG-in-CompileStatic-mode-quot-a-i-a-j-quot-won-t-work-td5714545.html) surfaced. You can get speed with bugs (i.e. static Groovy) or you can get reliability but slooooooow (i.e. dynamically-compiled Groovy), but you can't get both speed AND reliability. Quantum-effect programming languages are no use to anyone. – Vorg van Geir Mar 28 '13 at 13:08
  • 1
    Groovy is a language put on top of Java (i.e. adds some features to Java). Fairly complex systems have ben built with Java. So I don't think you need a very sophisticated language to write complex applications. I have added several Groovy compiler bugs to Groovy's bug base and I believe that Scala has the better quality compiler. But I don't think you need Scala because the application is demanding. The solution is in design and in the expertise of the problem domain, not that much in the language. – OlliP Mar 30 '13 at 10:14