• soulsource@discuss.tchncs.de
    link
    fedilink
    arrow-up
    4
    ·
    10 months ago

    There is also the y-combinator thread that discusses async as implemented in Rust compared to using Monads to represent async computations: https://news.ycombinator.com/item?id=17536441

    The arguments that withoutboats presented in that thread convinced me that Rust’s async is the better of these alternatives for a language like Rust.

    Another thing that helped to convince me of that is that I tried playing around with Free Monads and the Writer and State Monad in Rust, and found them to be very un-ergonomic. Rust is very explicit about heap allocations, and when using basically any Monad that’s more complex than Option/Result I found myself typing Rc::new() way more often than I would have liked… If you add do-notation to the mix, things get even more verbose (aka: annoying): https://github.com/bodil/higher/issues/6

    So, yeah. Rust async isn’t perfect, but it’s probably better to have it than not.