6 ms·
I write async rust for my day job, and while it is more complicated to write than synchronous rust, the complications generally make sense once you understand h
by mplanchard 5y ago
I write async rust for my day job, and while it is more complicated to write than synchronous rust, the complications generally make sense once you understand how the compiler is managing the remarkably tricky task of async with no GC. Rust remains significantly more pleasurable to write than e.g. typescript for me.
Some patterns around error handling still a bit awkward, but the FuturesExt and TryFuturesExt traits help a lot there.
My only real “I have no clue what’s going on” moment so far has been with an error about traits not being general enough, but someone on the rust forums helped me out: https://users.rust-lang.org/t/trait-is-not-general-enough-for-send-able-future/65396 https://users.rust-lang.org/t/trait-is-not-general-enough-fo...
Setting up clippy to disallow non-send-sync futures throughout the codebase has prevented that particular thing from recurring.