4 ms·
To be fair, that code is to illustrate the beauty of the language rather than efficiency. (Also the fibonacci sequence using 'zip'. Blew my mind.) Haskell fol
by reddit_clone 6y ago
To be fair, that code is to illustrate the beauty of the language rather than efficiency.
(Also the fibonacci sequence using 'zip'. Blew my mind.)
Haskell folks are fairly upfront about possible performance issues. Lazy evaluation comes with its own set of tradeoffs.
You can write very inefficient code in C++ if your algorithm isn't efficient.
- xiphias2 6y agoI still don’t see any tradeoffs explained, quite the opposite is on the home page: ,,The purity of Haskell code makes it easy to fuse chains of functions together, allowing for performance benefits.’’ Having something ,,beautiful’’ and inefficient is the problem I’m writing about. The language itself is guiding people to inefficiency. I haven’t felt this with C++, so I’m not sure what you are talking about: usually simple / pretty code runs fast there, and more complex code runs slower.