Saturday, February 6, 2010

Will Groovy++ spell the end of Scala?

by Richard Vowles

As much as we all "try to be friends", the successor to Java (and there clearly needs to be one) "battle" between Groovy, Scala and Clojure will IMHO, only heat up this year with the introduction of Groovy++. Groovy ++ adds to Groovy static typing with very little in terms of trade off (meta programming) - allowing mixing of static and dynamic code in the same application. Groovy++ apps are the same speed as Java - sometimes faster, sometimes slower depending on how the problem is expressed. IMHO, Groovy++ is really Java ++ and is thus a natural and easy path for the millions of Java programmers. Groovy not being controlled by the boffins at Snoracle hopefully means innovation in the platform can happen much faster and address real developer needs.

I personally don't see Clojure as a competitor for Groovy, Clojure seems to attract people interested in expressing primarily functional problems and can mix with other JVM languages easily. There is a place for it - I'm pretty sure it isn't everywhere (even though I am sure you can do everything in it) and it does my head in. I like Clojure, don't get me wrong, but I like it in the same way I like a regular trip to the dentist.

Scala on the other hand really decides to do things differently, and as I have said in the Illegal Argument podcast, I don't think its mixing of imperative and functional styles along with its weird, clearly academically experimental syntax will win out. Scala is an academic experiment built and designed by a very clever person. But... It is too different, it doesn't seamlessly interoperate with Java and it lends itself to unreadable code far too often. Clearly some people like it, but I can't for the life of me understand why they do. For me, it doesn't help that the primary Scala book written by Martin just reeks of language arrogance as well.

The argument i hear most often is "well, there isn't really a contender in Java.next for a statically typed language". Well, now there is - well almost - later in the year because of issues around open sourcing code.

Will Groovy++ spell the end of the use-case for Scala? Someone can take the Java spec and pretty much code in Java directly in Groovy++ - you can't do that in Scala. They can then be slowly introduced to type interference and all kinds of other programming concepts. Or they can take it the other way as a dynamic language and be introduced to the benefits of static typing. I certainly think it has a greater chance of supplanting Java than Scala does anyway.

No comments: