logoalt Hacker News

messeyesterday at 4:07 PM2 repliesview on HN

Synchronous Io also uses the Io instance now. The coloring is no longer "is it async?" it's "does it perform Io"?

This allows library authors to write their code in a manner that's agnostic to the Io runtime the user chooses, synchronous, threaded, evented with stackful coroutines, evented with stackless coroutines.


Replies

metaltyphoonyesterday at 10:57 PM

Except that now your library code lost context on how it runs. If you meant it to be sync and the caller gives you an multi threaded IO your code can fail in unexpected ways.

rowanG077yesterday at 4:15 PM

Rust also allows writing async code that is agnostic to the async runtime used. Subsuming async under Io doesn't change much imo.