Unfortunately the Clojure stack seems not to have much mechanical sympathy (despite its best intentions). It seems the natural/idiomatic way to use Clojure results in far too much dynamic behavior to be performant. Clojure may scale well, but its inherent bad performance (without lots of work) is a major downside.
This is simply untrue for most applications. I've been using Clojure and ClojureScript in production for more than two years now on a web app (front-end CLJS, back-end Clojure) and I've never had problems with it being sluggish for what I've needed to do.
When something isn't performing well enough, it's easy to profile and optimize, but in terms of building stuff out this is not something I have to think about; I focus on choosing the right data structures and abstractions. Of course, it's possible to slow things down simply by writing non-idiomatic code when you are first getting used to it (I speak from experience)--but that's not Clojure's fault: it's quite different from most mainstream languages and there is a learning curve.
For applications where you need performance like native Java, then sure, you need to optimize--add type hinting, use Java's mutable data structures, and more. I can't say too much about it because I'm not an expert on optimizing Clojure for high performance--I don't have to be.
>> For applications where you need performance like native Java, then sure, you need to optimize--add type hinting, use Java's mutable data structures, and more. I can't say too much about it because I'm not an expert on optimizing Clojure for high performance--I don't have to be.
This is what I'm talking about. Performance-wise, Clojure is all about scaling, not absolute performance.
From my point of view (lots of low-level, embedded, real-time,DSP,C,C++, etc). I personally get appalled at the performance that is left on the table when using idiomatic Clojure (and even Java)...
(Try doing an FFT in pure-idiomatic Clojure and compare to even a naive C implementation running on a lowly PIC32 or ARM...) it would be interesting what level of microcontroller your i7 is now reduced to.
I love the ideas behind Clojure and scalability is great... but when you're talking about scaling an application, make sure you're not throwing away silly amounts of performance before you scale it horizontally.
From my point of view (lots of low-level, embedded, real-time,DSP,C,C++, etc). I personally get appalled at the performance that is left on the table when using idiomatic Clojure (and even Java)
Okay, but that's a very different statement than your initial post where you wrote "the reality seems to be of a really under performing language." The value proposition for Clojure includes well thought-out high level abstractions, great built-in immutable data structures, interoperability with Java and JavaScript, all the stuff that comes with being homoiconic, and more. The value proposition for Clojure does not include programming for embedded systems, building low-level systems software, or wringing out every last bit of performance from your hardware. "Inherent bad performance," as you put it previously, is relative to the problem space you are working in.
its not a different statement, Clojure is (partially) sold as a performant language, partially thru its links to Java, partially because of 'scaling' I suppose. What I'm saying is that it isn't truly performant.
Like you say, the strong points of Clojure are the homoiconicity, immutability, STM etc. It seems to me that as soon as you attempt to use the good bits of Clojure, performance goes out of the window, which is a real shame.
BTW: I wasn't indicating I thought Clojure was intended for embedded s/w, just indicating that I have an interest in true performance, not just scalability due to my background in embedded s/w.
Don't get me wrong, I like Clojure and it has its place, but its just a shame that in order to use its strengths, you pay a big price.
This is simply untrue for most applications. I've been using Clojure and ClojureScript in production for more than two years now on a web app (front-end CLJS, back-end Clojure) and I've never had problems with it being sluggish for what I've needed to do.
When something isn't performing well enough, it's easy to profile and optimize, but in terms of building stuff out this is not something I have to think about; I focus on choosing the right data structures and abstractions. Of course, it's possible to slow things down simply by writing non-idiomatic code when you are first getting used to it (I speak from experience)--but that's not Clojure's fault: it's quite different from most mainstream languages and there is a learning curve.
For applications where you need performance like native Java, then sure, you need to optimize--add type hinting, use Java's mutable data structures, and more. I can't say too much about it because I'm not an expert on optimizing Clojure for high performance--I don't have to be.