@cwebber @KitRedgrave I managed hack something like co-routines in by abusing self-modifying eval code. For a while in chrome could be tricked into spawning sub processes that communicated with the main thread via shared-webworkers. it was a nightmare of monkeypatching+AOP that ended up acting similarly to how yeild converts a python function into a generator object.
It was ran via a statemachine that would self-modify the functions by reasigning new function on the fly.
async stuff, js musing Show more
@KitRedgrave async / await makes this a bit better in javascript
BUT STILL
the right answer is to have coroutines (ideally by delimited continuations) in a way that's much more cleanly baked into the language
Racket / Guile do this in a sane way. async stuff can be made completely clean and look like everyday straightahead coding.
Every time I program in javascript I get so angry because of this.