3 ms·
> Haskell is lazy, which paradoxically means that its execution is sequential. I don't understand what you mean.
by jberryman 12y ago
> Haskell is lazy, which paradoxically means that its execution is sequential.
I don't understand what you mean.
- adwn 12y agoAlthough I don't agree that "lazy => sequential", what he/she probably means is that Haskell's lazy execution model sets constraints on program execution, in analogy to an imperative language, which also sets contraints on execution order. Advantages of an unspecified execution order: more compiler optimizations allowed/possible. Disadvantages: even harder to reason about. In fact, some functions may or may not terminate, depending on the whims of the compiler.
- conal 12y agoTermination (really, non-bottom-ness vs bottom-ness) is a semantic (denotational) property, independent of the whims of any correct compiler. Execution/evaluation order, on the other hand is an implementation (operational) choice. For an implementation to be correct, the termination or nontermination of generated code must be agree with the semantics of the language.
- dllthomas 12y agoIn principle, you can leave denotational properties unspecified in the language spec...