|
|
|
|
|
by bjoli
2571 days ago
|
|
Idiomatic java is like idiomatic C: pretty fast. Most smaller languages prioritize other things. Clojure has immutability and Haskell has purity. I have noticed this with every "X produces code faster than C": you begin with two programs that use a suboptimal algorithm, then you take your non-c language and try to write C in it. The result is always awful and removes most reasons not to use C in the first place. This has somewhat changed with rust and in some sense C++,but for other languages my point still stands. They have a nice idiomatic golden path that is fast enough for most cases. Once you need performance badly enough you have to treat you language as an assembler, and then you will always lose to languages that actually are good at that. I say this as a scheme/Haskell weenie. Writing really performance scheme and Haskell code often means writing ugly code. |
|
The same with Clojure, suddenly you start writing Java with parenthesis.
In the JVM, if you want absolute control over performance its better to just write Java for those parts (don't know much about Kotlin).