3 ms·
> I am also not clear what the advantage of multistacks is for side effect control. If you only ever push "effects" onto a stack, you're just building up a tra
by Twisol 5y ago
> I am also not clear what the advantage of multistacks is for side effect control.
If you only ever push "effects" onto a stack, you're just building up a trace. The CALM theorem (Consistency as Logical Monotonicity) tells us that concurrent systems can coordinate as long as published information is increased monotonically (rather than destructively changed); as a limiting case, traces are the trivial representation of a series of operations as a monotonically growing set of information.
The alignment between these domains makes me really excited for the next posts in this series. I'm expecting to see a restriction on "drop" for stacks of this type (as alluded to in this post). And if any reader only ever reads a limited suffix of the stack, the runtime (or compiler!) can eagerly prune unreachable parts of the stack.
Also, this makes me very excited for coroutines in this language. I don't think the "main" stack is specially identified in any way, it's just the stack you were using before focusing on another stack. Coroutines are then managed simply by focusing on their stack before resumption; their main stack is simply the ambient one we've set up for them. (Though you may have to do some amount of stack virtualization to avoid needing to generate new stack names; the multistack reduction I posited in a nearby comment relies incidentally on all stack names being statically known.)
- smaddox 5y ago> If you only ever push "effects" onto a stack, you're just building up a trace. That's an interesting concept, but not my plan for capabilities/effects. Instead, I'll be relying on linearity and qualified types. > Also, this makes me very excited for coroutines in this language. I am interested to see how they work out, too! I've only done a small amount of brainstorming about how they work. I'll likely need to give it some more thought as I formalize the multistack semantics.