Re: [stack] Laziness
"William Tanksley, Jr" <[email protected]> Sun, 23 May 2010 10:33:59 -0700
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <[email protected]> |
Ruurd <[email protected]> wrote: > The discussion is partly about what laziness is and partly about whether the language supports it as the default evaluation mechanism. Yes. > Haskell is lazy, Ocaml is strict. That is why Haskell is 9 times slower than Ocaml: http://www.cubbi.com/fibonacci.html False -- Ocaml is fast because it's deliberately impure. This allows the programmer to make speed-related decisions, thus allowing the compiler to succeed with much less specialized optimization code. Haskell is slow because it is pure; the programmer is (essentially) not permitted to write code for speed (it's possible, but the result is extremely ugly code with TONS of interwoven monads). New Haskell compilers become MUCH faster as their optimizers become more sophisticated (I doubt that Ocaml still holds a 9x advantage). As I said in my last post, it's more practical to be 99% pure than 100%. > By capturing data in a quotation Joy already offers lazy constructs. Of course, it is now up to the programmer to decide when and where the data is needed. Now the programmer can not be lazy. I don't see how you can claim that allowing list literals is similar to being a lazy language. That simply destroys the meaning of the word, to the point that machine language becomes a lazy language. -Wm