Clojure & Scala Similarities — Twins separated at birth?
bestinclass.dk
bestinclass.dk
After spending a fair amount of time using both languages (5-6 months each) IMO opinion it boiled down to what style is more suited for a specific project. dynamic + lispy or static + multi-paradigm.
One feature of clojure that I did miss in my scala project was macros. The reason I picked scala for the project was that I wanted static typing for the project.
Both languages are really neat and I would rather be using one of them instead of java.
Two other reasons I picked scala for that particular project was OO support and mutability. The problem fit OO better and performance was very important (I was anyway taking a bit of a hit choosing JVM over C), so with scala I had the option of for e.g. setting up a C like while loop with a counter rather than mapping a function.
This was maybe 6-8 months back. Since then clojure has added neat concepts like transients[1] which allowing mutability in a controlled manner within a function. So thats worth a look. I just preferred to go for a multi-paradigm language rather than a semi-pure functional language as I wasn't sure how the project needs would evolve.
What I would have really liked to do was use Python. I actually created an early prototype but the performance didn't meet the needs. I look forward to unladen-swallow :) Python did have some neat libs like struct[2] that would have worked.
IMO the choice of static or dynamic should be decided by the problem at hand. I feel dynamic tends to work for majority of projects so thats what I usually prefer but sometimes static works best.
[1] http://clojure.org/transients
[2] http://docs.python.org/py3k/library/struct.html#module-struc...
Clojure at least gives you some absolute guarantees about the immutability of its core data structures.
"Much simpler" could well be an exaggeration. I just multiplied my knowledge of Scala by N by looking at its Wikipedia entry and I didn't get that impression. To the extent you can avoid OO while writing idiomatic Scala there's no need for the latter to introduce a lot of accidental complexity.
(I've not explored Scala not because of anything having to do with it but because I'm very dedicated to Lisp.)
Scala is now 170,000+ lines of code. Clojure on the other hand is about ~30,000 lines of Java and 4,000 lines of Clojure.
Scala brings a very sophisticated and robust type system. This has it's benefits but it also seems to inject a considerable amount of of complexity. I haven't experienced Scala's type system so I won't venture further than that. If somebody asked me where the complexity was in Clojure I would answer thus:
1. Understanding the roles of the various concurrency primitives
2. Making idiomatic Clojure fast w/o resorting to mutable Java
3. Macros (if you haven't written them before)
Besides these three areas, Clojure is mind-blowingly and beautifully simple. I've found it to be as "conceptually" small as C or JavaScript while adding an incredible amount of expressive power.EDIT: I have no actual opinion about Scala. It looks like great technology.
This appears nothing more than a "I'm a fan of this language, mine is better" post. They're just different languages. Both do the same thing but in different ways and both happen to be on the JVM. Neither one is "better."
I really love clojure, but as I have said to others, have given up hope that a new type of lisp will catch on for more than a very small group. I would LOVE to be wrong about that.
SFD
The growth of Clojure has been exponential both among users and clients. A few years ago nobody could have imagined that a Lisp would have such rapid uptake, but it seems that the combination of a solid product, great libraries (JVM) and a productive community was all it took.
IIRC the Google Group is now in excess of 3000 members and if you'd like to try it out I suggest you follow it or join us in #clojure on irc.freenode.net - If you're a professional developer it'll be worth your time, if not you'll at least have some fun!
Reality check. Both are in the noise:
http://www.indeed.com/jobtrends?q=scala%2C+clojure%2C+python...
Edit: oooh, downmods
I recall "dons" (Haskell promoter) commenting on Reddit that it's awesome that 30% of Haskell's repositories can compile.
The amount of FOSS code in some collection means nothing.
http://www.indeed.com/jobtrends?q=scala%2C+clojure%2C+fortra...
Someday, they might even catch up to Fortran.