9 comments

[ 5.7 ms ] story [ 103 ms ] thread
Here is a seemingly relevant thread from the Clojure group: http://groups.google.com/group/clojure/browse_thread/thread/...

It was pointed out on there that this is not only a language comparison but a data structure comparison as well. Also, there are no type hints in the Clojure code. Without type hints it would be expected to run significantly slower. It's still an interesting comparison because you would generally only use type hints in performance bottlenecks. I'd be especially interested in seeing what kind of difference it would make in this case.

OK, let's write the performance critical part in Java or Scala and Clojure wins hands down for the rest, where we spend our development time at most.
Or write the whole thing in Clojure and drop to Java / Scala when you find bottlenecks. (In the same spirit of Python & Ruby people 'dropping to C' for performance when needed.)

It seems to me that Scala is becoming the de facto Java replacement; which strikes me as nothing but a good thing.

I know it's a controversial question but why do you prefer Clojure over Scala?
I don't think it's controversial at all. I prefer lisps in general, and that's pretty much the extent of it. I think Scala is a fine language, but it's not a lisp.
I see. I expected some technical reason, but obviously personal preference is fine too :)
Well... I guess you could say preference for lisps is a technical reason; but only if you are into macrology.
Out of curiosity, I wrote a simple non-optimized quicksort function in Common Lisp (SBCL) and timed a 180,000-element sort at 567ms, about half as much as the Java version. I'm sure that could be improved greatly with better coding and type hints.

Here's the code http://donnieknows.com/blog/sbcl-fast