3 ms·
I 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.rec
by chillee 9y ago
I 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."
- chillee 9y agoMy claim that Standard Chartered thinks "strict haskell is a lot easier to deal with" comes from this comment from Lennart. > If my only concern was semantics (i.e., input-output behavior) then I'd prefer call-by-name semantics, because I think it behaves more compositionally. But for practical concerns like resource consumption, debugging, stack trace, etc then strict evaluation is better. Overall though, you're right that my initial claims against strictness may have been a bit too harsh. If I could edit my initial comment, I would write something more like > 2. Laziness is often hard to use in practice. As Standard Chartered, a company that uses a strict variant of Haskell, notes: space leaks, difficulty of debugging, and hard to decipher stack traces are downsides to laziness. In my opinion, laziness definitely does have nicer semantics than strictness. It's more expressive and easier to compose. In practice though, I prefer strict languages mostly for the reasons Standard Chartered mentions.