Comparing strict and lazy
By Arnaud Spiwack
Comparing strict and lazy
Strict and lazy languages are often pitted against each other but rarely honestly compared. Let’s take a step back from the slogans and examine the trade-offs between lazy and strict. Not which is best: how they compare. — Most languages are strict. Haskell is very much the odd one out here. So it is not surprising that programmers in strict language sneer at Haskell’s laziness, nor that Haskell programmers feel compelled to defend this choice. But because of the adversarial nature of this debate, it ends up with cheap slogans such as “strict languages are more efficient”, “lazy languages compose better”. This doesn’t tend to be very enlightening. After all, the most likely answer, if maybe unsatisfactory is: it depends. The choice between strictness and laziness is, at the end of the day, as most things in engineering, a trade-off. And to make an informed choice between these two technologies, we need to know what the costs and benefit of each are. My goal, is to provide tools to make such an informed decision, by sharing, based on my experience as a programmer in both lazy languages and strict languages, strengths and weaknesses of both paradigm. If your looking for me to tell you which is best, you will be disappointed. But, on the plus side, there will definitely be some production horror stories.