4 ms·
Not trivially, no. Naive implementations in Haskell/F# are almost universally slower than naive implementations of the same algorithm in OCaml. In Haskell, this
by iamsohungry 11y ago
Not trivially, no. Naive implementations in Haskell/F# are almost universally slower than naive implementations of the same algorithm in OCaml. In Haskell, this is partly due to lazy evaluation (which many production Haskell projects turn off) and in F# it's largely due to the baggage of interacting with the CLR (I have less knowledge about this, I'll admit).
I think it only makes sense to talk about naive, idiomatic implementations of an algorithm when you're talking about the performance of a language. If you start talking about highly optimized versions of algorithms, it's harder to make statements about which language is faster. People who use numpy adeptly get extraordinary performance in Python, but I don't think that makes the argument that Python is faster than OCaml; it's hard to say what an equivalent level of optimization in OCaml would look like.