37 ms·
I wrote this on my phone a couple hours ago, and I wanted to add a couple qualifiers that might be misleading to people. Laziness being hard to deal with isn't
by chillee 9y ago
I wrote this on my phone a couple hours ago, and I wanted to add a couple qualifiers that might be misleading to people.
Laziness being hard to deal with isn't the only reason Standard Chartered uses their own compiler that's strict by default. However, they have noted that they do think strict haskell is a lot easier to deal with.
- tome 9y ago> they have noted that they do think strict haskell is a lot easier to deal with That's news to me. Where did they note that? Lennart Augustsson explicitly says "I don't think strict or lazy matters that much in practice; they both work fine". http://augustss.blogspot.co.uk/2011/05/more-points-for-lazy-evaluation-in.html http://augustss.blogspot.co.uk/2011/05/more-points-for-lazy-...
- chillee 9y agoI was basing off of this CUFP report regarding Standard Chartered's use of Haskell. http://anil.recoil.org/papers/2011-cufp-scribe-preprint.pdf http://anil.recoil.org/papers/2011-cufp-scribe-preprint.pdf > Their experience with strict semantics has been positive. Particularly useful is the ease of obtaining meaningful stack traces, tracking resource usage, debugging and exception propagation. The chief downside of strict semantics, in their experience, is the increased difficulty of modular composition FWIW, I am a bit jealous of how laziness makes it easier to achieve function composition, and that was something that I wish was easier in strict semantics.
- tome 9y agoUnless I've missed something there is no claim in that document about why SCB chose Mu to be strict.
- dllthomas 9y agoThe quoted passage can be interpreted as one - presumably the implication is that it had those attributes relative to alternative semantics (and might have been expected to do so).
- tome 9y agoIt's unfortunate that a short passage from an article not even written by either of the authors of Mu would be taken as evidence that SCB thought that strictness was better than laziness.
- chillee 9y agoI mean, if you want a direct quote from Lennart Augustsson, here's a quick transcription of the relevant parts of the relevant video. https://www.youtube.com/watch?v=hgOzYZDrXL0 https://www.youtube.com/watch?v=hgOzYZDrXL0 > So strictness is really fantastic, I must say. Stack traces work. When something goes wrong, you can say "so you call things from there to there to there". It's the single most time saving thing from Mu compared to Haskell, because things do go wrong from now and then, and it's so great to know exactly what went wrong... And strict languages have what I call resource composition. So if you understand the complexity of 2 parts you can stick them together and nothing weird happens. They add up. That's not true in lazy languages. And debugging, it's sensible in strict languages. And exceptions, they actually work! Strictness is great. It's terrible, also. So it has nice resource composition but it doesn't compose nicely semantically. So laziness has some good things as well. I think laziness is a much nicer way of programming except for these pesky resources. You definitely need some lazy functions, even C has lazy functions. And then he goes on to talk about the ways that they allow laziness in a strict language, and when they need laziness. Screenshots of relevant slides. Considering that the report was pretty much a summary of the talks given at CUFP, I don't know why you would cast doubt on its legitimacy. https://i.imgur.com/fqr5P8g.jpg https://i.imgur.com/fqr5P8g.jpg https://i.imgur.com/HieskA0.jpg https://i.imgur.com/HieskA0.jpg
- tome 9y agoIt seems we have have got a bit off track and my quite precise claims have got lost. My claims are that 1. It is incorrect to claim that "Laziness is very hard to get right in practice. ... It's the reason why ... Standard Chartered, uses their own Haskell compiler that's strict by default." 2. Rather, the reason Mu is strict is that it was designed to target an existing strict runtime (I offer this claim without proof but I was told this directly by one of the authors of Mu). 3. It is incorrect to claim that Standard Chartered "think strict haskell is a lot easier to deal with" 4. Rather, Lennart Augustsson holds that each has their upsides and downsides. He says "I don't think strict or lazy matters that much in practice; they both work fine" and "I think laziness is a much nicer way of programming except for these pesky resources."