"It only does what is needed!"
I didn't use Haskell but Nix and at least there it seemed reasonable to "not do" everything.
"It only does what is needed!"
I didn't use Haskell but Nix and at least there it seemed reasonable to "not do" everything.
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 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 that example cold actually happen, or at least I can't see how it would happen in Haskell.
* 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.
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.
It's true that there are also performance costs associated with laziness, but those weren't under discussion.
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).
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.