I've been programming in Java for the last few years, but due to disappointment with the current state of the language I'd like to switch to another JVM language with all the goodies of dynamic languages and features like closures, etc. I've looked around and Scala and Groovy seem the most popular choices. Am I missing other good languages? I'm favoring statically typed languages so currently I'm leaning towards Scala. I'd like to have other people's opinions on the matter and know if the community is large enough to ensure the future of the language.
views:
577answers:
6Looking for a JVM language without the cruft, should I pick Scala, Groovy, or something else?
Scala should be good.
With Scala you can have:
- Advantages of running on a JVM and using all of JVM tools.
- You can use all your Java libraries.
Scala has :
- closures and functions are part of lang.
operator overloading support.
supports interfaces which can contain implementation known as mixins
- concise and clear than java
Hope you have read this Daniel Spiewak blog :
http://www.codecommit.com/blog/scala/roundup-scala-for-java-refugees
Some more useful links:
http://creativekarma.com/ee.php/weblog/comments/why_scala_instead_of_java/
http://jim-mcbeath.blogspot.com/2008/07/mixing-java-and-scala.html
This question may help
http://stackoverflow.com/questions/2571267/modern-alternatives-to-java
Do you know that Groovy is in fact typed ? Its only downside, for that matter, is that it is weak-typed..
However, for a more complete reply, authors of Groovy frequently argue that Groovy is how Java should have looked, were it designed correctly (and 15 years later).
And Scala users often quote Groovy initial developer saying that Scala is Groovy as it should have been.
However, I tend to consider Scala to be far more (maybe too) functionnal than Groovy.
But I think the decision is only yours.
I think Scala has the tractions to be a viable alternative for the future. There is such a buzz and ecosystem springing up around it now so I do not see it going away in the near term.
Personally I am leaning to clojure right now, but I am afraid this might not suit your taste.
In any case I see a future with many more languages being used on specific projects and leverage their respective strengths. This is already the case with HTML, CSS, Javascript, XML, BPM, .... It is a matter of time before everyone realizes that 'coding' logic can be done in different languages too, each in their area of suitability.
Scala and Groovy are both great.
You should also add Clojure to your list to consider/research. It's newer than Groovy and Scala (and therefore probably has less visbility / following on the web so far) but has some very compelling features, particularly if you are interested in functional programming and concurrency.
My favourite features:
- Emphasis on high performance, immutable data structures
- "Code is data" philosophy with very powerful macro capabilities (as with most LISPs)
- Lazy evaluation and functional programming (somewhat Haskell-inspired perhaps?)
- It's a dynamic language, but is fully compiled and gets pretty good performance
- Very good interoperability with Java code
If you haven't seen it, I'd strongly recommend watching this video by Clojure creator Rich Hickey:
http://www.infoq.com/presentations/Value-Identity-State-Rich-Hickey