Hacker News new | ask | show | jobs
by jberryman 4184 days ago
> Haskell is lazy, which paradoxically means that its execution is sequential.

I don't understand what you mean.

1 comments

Although 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.

Termination (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.
In principle, you can leave denotational properties unspecified in the language spec...