https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
It's not that async infects. It's sync that infects and restricts. We are just used to it by default.
The fact that we started from sync was the cause of all the trouble of rpc because everything outside of CPU is innately async.
So make your utility functions sync whenever you can but make your platforms and frameworks async.
By contrast, calling async code from sync code requires a special blocking wrapper (Python) or unavoidably breaks control flow (JavaScript).
That's exaclty my point. If you don't have async by default in your platform you need to do stupid things to fake it. If function calls and main in Python were innately async you could be calling async code just as easily as sync code.
> [...] or unavoidably breaks control flow (JavaScript).
async/await syntax avoids it completely.
Tbh await should be default function call semantics and there should be special keyword for calling without awaiting. But since we come from sync primitives that would require small revolution that might happen at some point.
> Async is syntactic sugar
You could make sync code be syntactic sugar for await.
or python could have blessed gevent and done away with all the nonsense.
Your comment made me realize this is exactly what golang "go" keyword does. This is actually great.
The whole point of introducing async was to get away from callback hell.