This is perhaps not the right way to measure, but: When I last checked the programming language benchmark game [0], the Haskell submissions were basically as fast as C/C++/Rust. But, this came at the cost of writing non-idiomatically/non-functionally – essentially abusing the language to write C in Haskell. I would be curious how well "idiomatic" Haskell compares to C++/Rust, in terms of the compiler optimizing away the functional abstractions.
[0] https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
Look at both
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
and
https://benchmarksgame-team.pages.debian.net/benchmarksgame/...
> with flambda under sufficiently strong optimization flags, such compositions of operators should be compiled to an actual loop with no overhead!
I can't bet on what Java and JavaScript JITs make of map / forEach / filter / reduce, but I suspect that they can be pretty efficient, given the clear delineation and the repeated patterns.
Very few languages outside of Rust and Haskell actually do this reliably and that's including languages like Ocaml and F#. Rust and Haskell are certainly the only even remotely popular languages that do it.