marl
stack-switching
marl | stack-switching | |
---|---|---|
1 | 2 | |
1,781 | 102 | |
1.1% | 0.0% | |
5.7 | 10.0 | |
5 months ago | about 1 year ago | |
C++ | WebAssembly | |
Apache License 2.0 | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
marl
stack-switching
-
WasmFX: Effect Handlers for WebAssembly
I first heard of algebraic effects in a presentation about Unison recorded at Strangeloop. Realizing that exceptions, async, generators, and continuations could all be unified and implemented on top of one language feature was mind expanding.
It looks like the juicy details are in the Explainer:
https://github.com/WebAssembly/stack-switching/blob/main/pro...
-
Fiber in C++: Understanding the Basics
"Fibers", "green threads", "stack switching", "cooperative multitasking" are essentially all the same thing, they all rely on being able to switch to a different stack within the same OS thread. As such they can be implemented either in user space or by the OS.
Only downside of the technique is that it cannot be implemented in WASM, because WASM has separate data- and call-stacks and the call stack is not accessible from within the WASM virtual machine (while 'async-await' which relies on code transformation can be implemeneted in WASM just fine).
There is a 'stack-switching proposal' for WASM though, but I don't know how what's the state of that:
https://github.com/WebAssembly/stack-switching
What are some alternatives?
gruvi - Async IO for Python, Simplified
context
ghost-userspace
cgreenlet - Coroutines for C/C++
llvm-project - The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
assembly - assembly projects
concurrencpp - Modern concurrency for C++. Tasks, executors, timers and C++20 coroutines to rule them all