It'd be really cool to see something similar for Nim! Especially if it could embed logic proofs or invariants like Ada.
Note that it'd be possible to use Nim async to create a similar style setup too. Async functions are turned into iterator functions which are simple state machines storing the current function state. It's convenient as there's already a lot of knowledge / expertise around this sort of code. Though you'd need to have a priority queue based executor on the async-loop and change it to not rely on network based events but instead interrupts. I suspect signals and interrupts would work fine for that.
