Hacker News new | ask | show | jobs
by sliken 862 days ago
I'm fond of rust, but compared to go, I dislike that you need a different code path to support sync vs async in a module. Or pick a different runtime like Tokio. So you end up with modules that are async only, sync only, or both.

Makes me miss go, which has channels build in, has a runtime built in, and both are generally solid. None of use flavor A for this, use flavor B for that, or write wrappers for the wrong color function.

1 comments

Rust has channels built in. In fact, the std channels were recently rebuilt on top of the excellent crossbeam crate.

Function colors is kind of a meme but maybe-async functions are coming.

https://lib.rs/tokio is king for std environments, https://lib.rs/embassy for no_std.

Yes, MPSC, single consumer which is limiting.
Oh.

    cargo add crossbeam-channel