|
|
|
|
|
by sreque
6059 days ago
|
|
I haven't seen a compelling reason to switch to clojure either. Despite some people trying to argue to the contrary, fair benchmarks that I've seen put clojure on average at least 10 times slower than Java in CPU performance, and Java itself is often 50% slower than C or more. Why bother parallelizing when you're already 10-15 times slower? CPU's aren't free to run! They have to be purchased, consume power, require maintenance, and are prone to failure. Also, as far as productivity goes, I don't see clojure providing any significant short-term productivity gains over existing scripting languages like Python and Ruby. The use cases for macros beyond lazy evaluation appear few and far between in practice, and most of us get along fine in practice without persistent heterogeneous immutable data structures and lazy order evaluation. So, unless you enjoy learning languages for fun or find yourself thinking more clearly using a functional approach, and there appear to be many people on this site who fit into one or both of the above categories, you are just fine sticking with Ruby. |
|
Most of the benchmarks that I have seen that were legitimately 10x the time of Java were using unadorned Clojure on Clojure data structures... of course it is slower, the machine is doing a lot more for you.
And it is well and good that this is the case, because the purpose of Clojure is not to make that tight loop really fast; it is to get the logic of your program correct and avoid a lot of the subtle bugs that can happen. Concurrency has many advantages above and beyond parallelism.
As far as getting along without macros and lazy evaluation and heterogeneous immutable data structures, I will say that for a long time we got along 'just fine' without garbage collection; but now it is a feature of a large subset of languages (to the extent that Google has now added it to C).