4 ms·
I don't know anything about Jython or Scala, but I do know that Clojure does NOT have native Java speed. Clojure objects are Java Objects, so they must be boxe
by icey 18y ago
I don't know anything about Jython or Scala, but I do know that Clojure does NOT have native Java speed.
Clojure objects are Java Objects, so they must be boxed & unboxed by the JVM.
Clojure is decently fast, but well-written Java will continue to smoke it for some time to come.
- Tichy 18y agoSpeed is really the worst argument ever. For 99,99% of applications it really is not relevant, because they'll never have many simultaneous users.
- richhickey 18y ago> Clojure objects are Java Objects, so they must be boxed & unboxed by the JVM. I presume you meant Clojure numbers, because there is no notion of 'boxing' for reference types. For all non-numeric objects, the Clojure representation is the same as the Java representation. Type-hinted calls to methods of said objects generate the same bytecode as Java, with the same performance. As far as numbers, recent enhancements ( http://clojure.org/java_interop#primitives http://clojure.org/java_interop#primitives ) allow Clojure to produce primitive arithmetic with the same speed as Java, but with a more-powerful, macro-amenable syntax. While Clojure offers higher-order constructs with an attendant, but not prohibitive, cost, performance-oriented Clojure code can match the speed of Java.
- icey 18y agoRich, you're seriously some kind of linguistic superhero. Or maybe like the Monty Python version of the Spanish Inquisition. Either way, it's impressive. This: As far as numbers, recent enhancements allow Clojure to produce primitive arithmetic with the same speed as Java, but with a more-powerful, macro-amenable syntax." Just blows me away.
- icey 18y agoEh, it's too late to edit my other post, but the new design at Clojure.org looks great!