• sugar_in_your_tea@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Yes, there’s absolutely a lot of good reasons to use Rust over Go, even for heavily async tasks, I’m merely saying that Go supporting channels in the language makes it a lot easier to use for async tasks. There’s one proper way to send data between concurrent contexts, and that’s a channel, so it gets used a ton in library code.

    Rust could get a lot of that benefit by including channels in the standard library. We could still keep the async reactor code out of the standard library, but we’d need trait definitions there so the channels could hook into them.

    I personally think the Rust standard library should ship a complete async solution, with core bits being overridable (like with memory allocation), which would make it a lot easier to write clean async logic. I think the standard library should be single threaded, but be multi-threaded compatible, and then allow third party libraries to provide the multi-threaded capability.