3 ms·
Sorry, but this comment is pretty misinformed. Clojure has numerous facilities to address the performance issues you mentioned. You can, for example, annotate p
by gfodor 16y ago
Sorry, but this comment is pretty misinformed. Clojure has numerous facilities to address the performance issues you mentioned. You can, for example, annotate parameters to a function with type information to use primitives, java arrays, and remove the need for reflection.
Additionally, JRuby has had a JIT that attempts to do smart things to avoid unnecessary boxing and reflection. They've been rather impeded by the JVM on this front, but JVM 7 looks to open a lot of doors for the JRuby team to remove a lot of unnecessary dynamic dispatch in the execution of Ruby code.
The problem I see with Scala is it reeks of Perl 6's "everything and the kitchen sink" language feature-a-thon. Having learned Clojure and started Scala recently I'm constantly asking myself why Scala code has so much incidental complexity compared to the equivalent Clojure code. Often, it is due to the type system or the excessive number of constructs and syntax available in the language.
- whakojacko 16y agoOdersky writes a good post about the kitchen-sink aspects that a lot of people complain about vs java: http://scala-programming-language.1934581.n4.nabble.com/The-right-tool-td2220305.html#a2222101 http://scala-programming-language.1934581.n4.nabble.com/The-... Having used Scala for a lot of side projects, the only thing that seems kitchen-sinky to me is native XML support.
- sreque 16y agoI thought you might bring some of that up! :) Unless this URL (http://clojure.org/java_interop http://clojure.org/java_interop) is out of date, then I fail to see how I'm misreading this section. "All arguments are passed to Clojure fns as objects, so there's no point to putting non-array primitive type hints on fn args. Instead, use the let technique shown to place args in primitive locals if they need to participate in primitive arithmetic in the body.". Also, I'm not an expert on JRuby's attempted optimizations, but if I understand correctly they are very limited, much in the same way that Java's escape analysis is. The post By Charles Nutter less than a year ago is illuminating in that regard(http://groups.google.com/group/jvm-languages/browse_thread/thread/2c10bde4b9985086 http://groups.google.com/group/jvm-languages/browse_thread/t...). Have things changed that significantly since then? I follow his blog regularly and in most benchmarks I can remember him talking about he still compares JRuby to Java running boxed math.