2 ms·
> What part of async Rust is more complicated than synchronous Rust? The Rust part, of course :) Seriously though, the compiler error messages alone make it a
by akiselev 6y ago
> What part of async Rust is more complicated than synchronous Rust?
The Rust part, of course :) Seriously though, the compiler error messages alone make it a major pain - although I can't figure out if it's an issue of maturity (language and ecosystem), a fundamental tradeoff with Rust's borrow checker, or me just getting way ahead of myself.
I can rarely go a few days of async programming in Rust before running into some esoteric type or borrow checker issue that takes hours to solve because I borrowed some non Send/Sync value across an await point and the compiler decides to dump a hot mess in my lap with multi-page long type signatures (R2D2/Diesel, looking at you).
- estebank 6y agoThose subpar diagnostics are a bug. The underlying reasons are that - The async/await feature is an MVP - async/await desugars to code you can write yourself that leverages a bunch of relatively advanced features, namely trait bounds and associated types - It also leverages a nightly only feature (generators) - Async programming is inherently harder :) - We've had less time to see how people misuse the features to see where they land in order to clean up those cases and make the errors as user friendly as they can be Put all of those together and the experience of writing async code in Rust is similar to the experience of writing regular Rust code maybe two or three years ago. When you encounter things like this, please file a ticket at https://github.com/rust-lang/rust/issues https://github.com/rust-lang/rust/issues so that we can fix them.