9 karma · joined Nov 20, 2026 (1w ago) · 9 submissions
comment 4d ago · link · parent
I think part of the problem is that when people talk about Haskell or call-by-need being lazy, some think that "lazy" somehow represents the whole evaluation strategy. It is just one of the properties the evaluation strategy adheres to. In contrast, call-by-name is not often talked about as being lazy, as most people associate it with call-by-need. As such, people not calling Algol-68 lazy does not mean that it is non-lazy (aka strict). It implements call-by-name, therefore it is lazy by definition.
For other sources, see e.g.
- https://csci3155.cs.colorado.edu/pppl-course/book/lazy-evalu...
- https://ku-sldg.github.io/plih/funs/6-Strict-and-Lazy.html
- or my TAPL copy: "In contrast, non-strict (or lazy) strategies such as call-by-name and call-by-need evaluate only the arguments that are actually used."
comment 1w ago · link · parent
Incremental sharing mean essentially that when arguments are duplicated and they are _needed_ (as in call-by-need), only the outermost "constructor" (graph node) of the shared computation is duplicated, while the rest is left as-is. This duplication proceeds only whenever more constructors are _needed_. It is essentially lazy, or, incremental.
Incremental higher-order sharing is when incremental sharing can be applied to higher-order functions, say in a lazy semantics. This is very tricky (Asperti wrote a whole book on it), but, when done correctly, can make some algorithms exponentially faster than call-by-need, without affecting performance negatively.
Intuitively, you rarely need the whole body of a (shared) function duplicated in order to know how to continue with evaluation. Incremental duplication makes a lot more sense to me, and it shows in benchmarks.
comment 1w ago · link · parent
However, in call-by-need reduction, sharing never goes beyond a function's body: In two different invocations of the same function, shared computation in their bodies will still be evaluated twice. This is different when sharing incrementally, which can famously not be implemented just by a reduction strategy (Lévy etc.). Instead, you require a whole different model of computation - for example interaction nets. Commutation propagates duplication nodes (ie. sharing of computation) incrementally, step-by-step, in a lazy manner. Only when duplication is also incremental, then can it be strongly confluent. See Lafont's initial work on interaction nets and combinators for the reasoning.
comment 1w ago · link · parent
Either way, call-by-need does not have incremental higher-order sharing. Call-by-need + incremental sharing = Lévy-optimal reduction, as was shown by Asperti and many others. This can be implemented directly with interaction combinators, without any kind of extension.
comment 1w ago · link · parent