Comment by flohofwoe

Comment by flohofwoe 2 hours ago

1 reply

> In that case JS is not colored either because an async function is simply a normal function that returns a Promise.

Exactly, IMHO at least, JS doesn't suffer from the coloring problem because you can call async functions from sync functions (because the JS Promise machinery allows to fall back to completion callbacks instead of using await). It's the 'virality' of await which causes the coloring problem, but in JS you can freely mix await and completion callbacks for async operations).

zarzavat 2 hours ago

await isn't viral per se, it's a purely local transformation. The virality is from CPS/callbacks and Promise.