Comment on Zig: Upcoming release postponed two more weeks and lacks async functionsparentComments−xxpor3yUsually the coloring problem IME goes the other way: you want to run a synchronous/blocking function in an async context. How does Zig deal with that?−lvass3yFunction calls?−Nullabillity3yAnd now you're blocking the event loop.−lvass3yIf you chose to use cooperative concurrency, it's because you can make it cooperate. Use preemption otherwise.−j16sdiz3yThey have await keyword. This is noop in sync mode−kprotty3yDid you mean the `nosuspend` keyword? It only asserts nothing suspends rather than there being a "sync" mode.
Comments
Usually the coloring problem IME goes the other way: you want to run a synchronous/blocking function in an async context. How does Zig deal with that?
Function calls?
And now you're blocking the event loop.
If you chose to use cooperative concurrency, it's because you can make it cooperate. Use preemption otherwise.
They have await keyword. This is noop in sync mode
Did you mean the `nosuspend` keyword? It only asserts nothing suspends rather than there being a "sync" mode.