Login
You're viewing the ruby.social public feed.
  • Dec 2, 2026, 3:05 AM

    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 babeljs.io/docs/babel-plugin-t and its immediately the browser based interactive experience i've always wanted 🔥

    💬 1🔄 0⭐ 0

Replies

  • Dec 2, 2026, 3:19 AM

    my approach to coroutines is also now fully based on signals rather than global schedule objects. this is much more powerful and flexible and unifies input and control flow. having a first class object that acts like an event with callbacks that i can await in coroutines is not something i can live without

    💬 1🔄 0⭐ 0
  • Dec 2, 2026, 3:21 AM

    thats old stuff that has seen vast improvement. some new stuff that landed is a "router" that works like vue-router but instead of mounting a component for each url it runs a coroutine. if the url changes it cancels the current running coroutine -- allowing it to clean up in its try/finally if any -- and runs the coroutine associated with the new url

    💬 1🔄 0⭐ 0
  • Dec 2, 2026, 3:24 AM

    i also have an approach to browser synchronization i am excited about 💻️ ⚡️ 📲

    💬 1🔄 0⭐ 0
  • Dec 2, 2026, 3:25 AM

    ive made three things this year in the new stack, with possibly one more on the way. i will rewrite gibraltar using this tech in 2027 and hopefully that will be done by the end of the year.

    💬 0🔄 0⭐ 0