Friday, October 14, 2016

Scala vs. Groovy vs. Clojure

Scala
Scala evolved out of a pure functional language known as Funnel and represents a clean-room implementation of almost all Java's syntax, differing only where a clear improvement could be made or where it would compromise the functional nature of the language. Such differences include singleton objects instead of static methods, and type inference.
Much of this was based on Martin Odersky's prior work with the Pizza language. The OO/FP integration goes far beyond mere closures and has led to the language being described as post-functional.
Despite this, it's the closest to Java in many ways. Mainly due to a combination of OO support and static typing, but also due to a explicit goal in the language design that it should integrate very tightly with Java.
Groovy
Groovy explicitly tackles two of Java's biggest criticisms by
·         being dynamically typed, which removes a lot of boilerplate and
·         adding closures to the language.
It's perhaps syntactically closest to Java, not offering some of the richer functional constructs that Clojure and Scala provide, but still offering a definite evolutionary improvement - especially for writing script-syle programs.
Groovy has the strongest commercial backing of the three languages, mostly via springsource.
Clojure
Clojure is a functional language in the LISP family, it's also dynamically typed.
Features such as STM support give it some of the best out-of-the-box concurrency support, whereas Scala requires a 3rd-party library such as Akka to duplicate this.

Syntactically, it's also the furthest of the three languages from typical Java code.

No comments:

Post a Comment