3 ms·
How to avoid correctness space leaks on a lazy setting in Haskell
- hgsgm 4y ago25 years after Haskell 98, and we're struggling to get basic control over memory usage in our programs, in language designed for the "BDSM" of forcing you to write highly correct code at compile-time.
- nullcaution 4y agoAnd? The developers of Haskell owe us nothing. I don't see the point of your complaint. If the tool doesn't fit the bill, don't use it. IMO Haskell is more of a dream project of having a highly optimizable and flexible complier. Its fun to write, great when it works (well), but it's not the workhorse of C and Python.
- whateveracct 4y agoThis is a pretty hyperbolic take imo. Anecdata, but I've seen more space leaks in non-Haskell languages than Haskell in production despite having more production years of experience in Haskell over the last decade. Space leaks really are not a big issue.
- klntsky 4y ago> and we're struggling to get basic control over memory usage You have to understand runtime of any language in order to write memory-efficient code in it. Lazy runtimes are predictable once you know how they work.
- whateveracct 4y agoIt's somewhat telling that the first comment on a blog post about having control of laziness is about how "we struggle to control laziness" .. seemingly using the blog post's existence as proof that we don't have control?
- deleted 4y ago[deleted]
- tuukkah 4y agoLaziness by default has been a huge experiment in Haskell and we haven't gotten to the bottom of it yet. Summary in the end: > these defensive coding patterns enable me to use lazy evaluation to have more compositional power, it is a trade-off.
- slacknatcher12 4y agoHi, author here. I just want to add that this post makes more sense if it is read as a continuation of the argument made on here <https://epicandmonicisnotiso.blogspot.com/2023/03/an-apologia-of-lazy-evaluation.html https://epicandmonicisnotiso.blogspot.com/2023/03/an-apologi...> which had comments on HN on here <https://news.ycombinator.com/item?id=35305546 https://news.ycombinator.com/item?id=35305546> BTW: I am open for hiring :^)