4 ms·
What about a more imperative shape? What if you could have a closure that "goto"s into the parent function scope? Or imagine coroutines built with `swapcontext
by bruce343434 3y ago
What about a more imperative shape? What if you could have a closure that "goto"s into the parent function scope?
Or imagine coroutines built with `swapcontext` (man 3).
- zozbot234 3y agoStackful fibers are an anti-pattern. See Gor Nishanov's review for the C++ ISO committee http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1364r0.pdf http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p136... linked from https://devblogs.microsoft.com/oldnewthing/20191011-00/?p=102989 https://devblogs.microsoft.com/oldnewthing/20191011-00/?p=10... . Notice how it sums things up: > DO NOT USE FIBERS!
- gpderetta 3y agoLet's say that not everybody agrees. Also all the issues identified by Gor are due to retrofitting continuations into an existing language as a pure library without compiler help.
- anonymoushn 3y agoCan Gor Nishanov post one of his hand-made state machines that handles several nested protocols? Or does he believe that operating systems are good at scheduling work across 100,000 threads?
- bruce343434 3y agoHuh? That might be exactly how "effect handlers" are implemented.