Re:Dialects of Lisp
by dschiptsov on Saturday February 23, 2013 @02:19AM
(#5268879)
What kind of purity and laziness cannot be done in Scheme?)
Unrestricted beta reduction. You really should know that if you want to take a position of authority on the differences between programming languages.
Re:Dialects of Lisp
by dschiptsov on Saturday February 23, 2013 @02:24PM
(#5271079)
I have no such intention.
The big problem is that reasoning about non-strict evaluation is quite non-intuitive (although not impossible.) It's quite easy to write code which seems inefficient that runs in no time at all, and equally easy to write code that seems efficient that takes a long time to run. It requires a rough understanding of how your compiler is optimizing your program and what the resulting code is doing, which can be tricky. Laziness also (not surprisingly) interacts with side-effects in a complicated way, so much work has been done to alleviate the problems with lazy IO, e.g. iteratees [3].
So, yes, sometimes it's a great thing, and sometimes it's a problem. The position of the Haskell community is that the exploration of how to properly leverage laziness is worth the tradeoff, but there is indeed a tradeoff.
[1]: http://augustss.blogspot.com/2011/05/more-points-for-lazy-ev...
[2]: Infinite data structures (i.e. codata) can be written/created in a strict language, but the ability to write them falls out of laziness quite naturally, and a lot of people experience them for the first time in a lazy context.
[3]: http://www.haskell.org/haskellwiki/Iteratee_IO