2 ms·
> because any code outside of async doing I/O is not good to use inside of async This is (somewhat) similar in all programming languages and it is called colou
by miohtama 4y ago
> because any code outside of async doing I/O is not good to use inside of async
This is (somewhat) similar in all programming languages and it is called coloured function problem:
https://news.ycombinator.com/item?id=8984648 https://news.ycombinator.com/item?id=8984648
- kibwen 4y agoThe way you solve that problem is either 1) just use threads, which is fine for almost every program with the notable exception of webservers (and even for webservers an aversion to threads is often a premature optimization), or 2) make everything async at the language level by transparently intercepting all I/O, which is acceptable for a managed language (so, most languages) but undesirable for a language with bare-metal aspirations like Rust (we're writing a bare-metal hypervisor-ish thing, and we're using Rust because very few languages are acceptable for such a constrained use case (we're not using async for it, but hilariously we could be, since Rust's stackless approach is suitable even for systems too constrained to have threads in the first place)).