Sat Dec 21 15:15:53 CET 2019

Using a stack as a code sequence

Implementing a binary search, I am reminded of the idea that the
explicit stack used in the algorithm can also as a code sequence, by
loading the code sequence in the form of continuations in reverse

Basically, this reduces the complexity of a sequencing structure.
Instead of sequence + stack, it is now just stack + an initializer for
the stack (which is non-blocking and thus has no abstraction cost).


Why can't a stack just consist of function calls?  Basically, event
handlers, instead of jump points. Yeah the hybrid instruction
vs. resume point idea.

It's somehow dual: event handlers have inputs but no outputs, only
side effects (message send + state update).