Please note that I am not personally building a new runtime, that’s just the title of the article.
If smol doesn’t depend on mio, then how does it do the actual non-blocking I/O? Do we still have to use async-std and/or tokio for that part?
It wraps the stdlib’s TcpStream and friends with epoll (on Linux) and other platform specific APIs to determine when to wake up waiting tasks.
Isn’t that what mio does? Was mio’s API just not the right API for what you needed?
So, I’m not the creator, but stjepang was nice enough to let me take a look early.
It does look like mio uses epoll under the hood (though it’s abstracted a ton), however there’s a lot of code there. As far as I can tell, a major reason for wanting to write this async runtime was to show how simple a full feature-complete runtime can be. The entire implementation of smol (including documentation and newlines, excluding external dependencies) is under 2000 lines. mio itself is over 7500.
Looking forward to trying it out!
That is a bit frustrating: I want to read more now!