Besides where a sibling comment says I mentioned it, I also mentioned it near the end:
> Third, async is, in fact, viral. The language reference says,
>> Zig infers that a function is async when it observes that the function contains a suspension point. Async functions can be called the same as normal functions. A function call of an async function is a suspend point.
> (Emphasis added.)
> In other words, if you call an async function, your function gets a suspend point, which means that your function becomes async.
> In fact, if you look at Bob Nystrom’s point 3, “You can only call a red function from within another red function,” this means that Zig fits point 3!
> What Zig does differently than Bob Nystrom’s “hypothetical” language is that if it sees you call a red function from a blue function, it shrugs its shoulders, makes the blue function red, and does not tell you. This gives the appearance of being able to call red functions from blue functions while still only allowing red functions to call red functions.
That's interesting. So this means that the only thing Zig does is auto-insert the 'async' qualifiers in front of functions instead of requiring you to insert them?
As far as I understand it, yes, as well as, insert an `await` right after, turning the enclosing function itself `async`, which means that anything that calls the enclosing function (the caller) would also need to have `async` and `await` inserted, and the process would keep going.
That is what I mean by viral: if a function low in the call chain is turned `async`, every function above it is too.
Besides where a sibling comment says I mentioned it, I also mentioned it near the end:
> Third, async is, in fact, viral. The language reference says,
>> Zig infers that a function is async when it observes that the function contains a suspension point. Async functions can be called the same as normal functions. A function call of an async function is a suspend point.
> (Emphasis added.)
> In other words, if you call an async function, your function gets a suspend point, which means that your function becomes async.
> In fact, if you look at Bob Nystrom’s point 3, “You can only call a red function from within another red function,” this means that Zig fits point 3!
> What Zig does differently than Bob Nystrom’s “hypothetical” language is that if it sees you call a red function from a blue function, it shrugs its shoulders, makes the blue function red, and does not tell you. This gives the appearance of being able to call red functions from blue functions while still only allowing red functions to call red functions.
So I argue that Zig actually does fit point 3.