3 ms·
So you've never had a space leak? Be honest...
by BaseballPhysics 3y ago
So you've never had a space leak? Be honest...
- the_af 3y agoI've seen lots of things and problems in languages both with and without lazy evaluation. On the whole, I like it in Haskell. In languages without lazy evaluation (by default) I tend to miss it. I've never seen it "ridiculed" by anyone proficient with the language or who used it for an actual project, either.
- BaseballPhysics 3y agoGreat non-answer. Meanwhile, no honest Haskell developer can claim to have never been surprised by a space leak at one time or another. Why? Becauze laziness is simply harder to reason about. It's a lot like coding in something like Prolog, in that you need to internalize not just the behaviour of the program, but the behaviour of the Haskell runtime as well, and how laziness is actually implemented. This makes it very challenge to reason about both space and time reliably, even for a seasoned developer. The fact that whole tutorials are dedicated to picking the right fold so you don't leak space is a perfect encapsulation of the problem. And for a language that emphasizes compile-time safety, it's a major class of bug that neither the compiler nor runtime help the user detect. I've worked in many different languages and runtimes over the years and I've never encountered another feature that was equally complex.
- the_af 3y ago> Great non-answer. Meanwhile, no honest Haskell developer can claim to have never been surprised by a space leak at one time or another I did answer. I've been hit by them. In general, the problems are fewer than without laziness, though. I've seen more problems in production caused by careless eager evaluation. Are you an "honest Haskell developer" by the way, that you speak for all of them? "Be honest" in your answer, please. > Becauze laziness is simply harder to reason about. No, it's harder to reason about some aspects and easier to reason about some others, like gluing together code. > I've worked in many different languages But not Haskell, right? "Be honest". I've never seen laziness ridiculed (not critiqued, but ridiculed, remember the context of the conversation you're in) by an actual practitioner, have you? "Be honest".
- BaseballPhysics 3y ago> But not Haskell, right? "Be honest". I absolutely have worked with Haskell and written a number of non-trivial programs in it, including a bytecode interpreter for a toy virtual machine. I also spent quite a bit of time writing solutions to various coding challenges in Haskell, which gave me an appreciation for how hard it is to write high performance code in the language (anything touching strings, in particular, was a real joy...). I've never felt like I had to fight the runtime quite the way that I had to fight it with Haskell. But yes, if I'm writing normal, run-of-the-mill, low complexity code, it's pretty easy to get Haskell right. But then in that circumstance it's easy to get it right in any language. Of course, why would you believe me? You're already so sure your opinion is fact that I doubt anything I have to say will sway you.
- the_af 3y agoNo, I believe you. Why wouldn't I? It's you who accused me of giving non-answers and asked for my "honesty". Fair enough. Haskell developers do not think the language is perfect, and I've seen a fair share of critiques, but I've never seen laziness "ridiculed". And since I believed you, believe me: whenever I deal with languages without easy recourse to lazy evaluation, I miss it. Every expression is clumsier. > You're already so sure your opinion is fact that I doubt anything I have to say will sway you. Are you a mind reader? I suggest you go back and look at your first reply to me. Do you think it was crafted to elicit good mannered conversation?
- BaseballPhysics 3y ago> I suggest you go back and look at your first reply to me. Do you think it was crafted to elicit good mannered conversation? Yup, that's fair, I came out swinging because I read this: > They only ridicule it because they don't use it or understand it. As belittling the intelligence of people who didn't share your opinion. If that wasn't your intention and I read too much into your comment, then I absolutely apologize for jumping down your throat so aggressively.