1. 41

This is mostly written for Rust programmers, however it does give an overview of “what is Rust’s async IO plan?’ which might be interesting to some. Feel free to ask if some rust stuff isn’t clear.


  2. 3

    Great writeup that’s answered some questions I’ve had myself about tokio, since its not a problem domain I have much experience with but gets a lot of discussion in rust-related fora.

    1. 0

      I have this horrible horrible feeling that Rust is becoming the new Perl. This all reminds me of when Perl added “object orientation” and things became more confusing and hard to understand for passers by like myself.

      1. 5

        Every serious new language needs to be able to solve the c10k problem; we knew Rust would need async I/O sooner or later.

        What is ugly is the proliferation of macros when a proper general-purpose solution is possible. If you look at the final example from the link, async! is fulfilling exactly the same role as the notorious try!; if the language would adopt HKT they could build a single reusable standard form of “do notation” into the language and reuse it for result, async, option, and many other things: https://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/

        1. 6

          It is extremely unclear that a strongly-typed do notation is possible in Rust. It’s also not clear if we’ll ever get HKT directly; GAT gives us equivalent power, but fits in with the rest of stuff more cleanly.

          1. 3

            What is GAT?

            1. 2

              generic associated types

          2. 1

            I think async! will eventually be made into a language feature (a couple of community members have proposals for this), it’s just that we’re experimenting on it as a proc macro, because we can. It’s way more annoying to experiment with features baked into the language.

          3. 1

            The only language feature added here is generators (and possibly, async/await sugar), everything else will be a library. Both things are quite common amongst languages; and shouldn’t be too confusing.

            Everything else listed here is a library that you only deal with when you are doing async stuff. And the complexities listed are largely internal complexities; tokio should be pretty pleasant to work with.