Haskell can be made very fast. The problem is that at least for me, performance is often quite non-intuitive. As in, make tiny change to program, it is now a hundred times slower. Then you get to hunt down the reason why it's now doing too much work/ why stream fusion isn't working anymore/why it's leaking so much space/etc for hours.
I enjoy writing Haskell for small hobby projects, but I doubt I would choose it for real work now that F# and Rust exist.
In other languages when the compiler misses an optimization you get a constant order penalty on a small piece of code.
In Haskell when the compiler misses an optimization the performance hit is potentially unbounded, as it could think anything is a dependency. (You want the first N digits of pi? Just wait while I calculate all of them for you...)
I don't think anything is the unique selling point of laziness. Wikipedia[1] says "The benefits of lazy evaluation include:
* The ability to define control flow (structures) as abstractions instead of primitives.
* The ability to define potentially infinite data structures. This allows for more straightforward implementation of some algorithms.
* Performance increases by avoiding needless calculations, and error conditions in evaluating compound expressions."
In my several-year experience as a professional Haskell developer the first and second points are at least an order of magnitude more important than the third.
"the first and second points are at least an order of magnitude more important than the third."
No offense, but 'performance is not as important as...' is what basically all pro-FP devs say for years, still it seems that the rest of the world thinks exactly the opposite.
I make no claim about the importance of performance.
My claim is that the performance gains brought by lazy evaluation are far less important than the other gains it brings (because the performance gains it brings are rather small).
It's hard to believe that a world where Ruby, Python and Node are massively popular cares about performance above expressiveness. Even Java became popular first and fast afterwards—not even talking about memory efficiency!
I'd agree that a lot of developers still over-index on performance though, probably because it's sexy and easy to measure.
> I'd agree that a lot of developers still over-index on performance though, probably because it's sexy and easy to measure.
To keep producing responsive compute programs as the complexity of those programs continues to rise while the single-core CPU performance remains steady, program performance must become more and more important.
"It only does what is needed!"
I didn't use Haskell but Nix and at least there it seemed reasonable to "not do" everything.