Op di 25 nov 2025 om 12:54 schreef Rob Landers <rob@bottled.codes>:
> ... Adding an "async" to the function makes it return a Coroutine, that can be
> awaited.
This is just a different flavour of coloring. You would now have
functions that have "async" and functions that don't have "async".
> Then, when/if you call await on this coroutine, and we're not already in a coroutine, it
> will spawn one for us, blocking until it returns. If we are already inside a coroutine, then it
> blocks until the coroutine completes.
> Then you have coloured functions when you want them, but can call them without having to change
> your code or "infect" your code with async/await. Its literally just sugar over the
> currently proposed RFC, as you'd have to return Coroutines and await them anyway, but this is
> actually more type-safe.
At this point you need to know that a function is async because you
need to know if you need to call await on it. Without coloring, you
don't have this problem.
Let me see if I can find some time to create some examples using
ReactPHP on Github and then we can explore some additional syntax
there to see what it would feel like as a developer?