the big change is i finally caved and wrote a small vite plugin compiler pass for my coroutines. for a long time i clung to the ability to use ajeeb without a build step but honestly the experience with this plugin is so categorically better that i am happy to declare defeat...
it turns
async function foo() { await bar() }
style code into
function* foo() { yield* bar() }
generator style code.
async/await is *much* nicer syntax, supports arrow functions, and preserves type information across await boundaries. its night and day.
the problem is the runtime semantics of promises are not usable for media art/games. promises cannot be cancelled and they are scheduled by the browser making frame-accurate logic impossible.
generators have the opposite problem. their runtime semantics are *perfect* -- they can be cancelled, they support clean up with try/finally, i can schedule/advance them in library code, literally everything i could ever want. but they are awful statically... no arrow functions, and no type information across yield...
the solution is a tiny vite plugin that mostly just wraps https://babeljs.io/docs/babel-plugin-transform-async-to-generator/ and its immediately the browser based interactive experience i've always wanted 🔥