just necro'ing this thread [Edit by moderators: we've moved this into a separate topic, after all] here with a rant, async rust feels like an overengineered nightmare, you implement Future and then it polls once, returns pending, then does nothing, unclear why this is acceptable developer experience, how the **** do we have to rely on a hodge podge of 3rd party interfaces and everyone just gets locked into tokio, do we use std futures, core futures, futures futures, do we use futures stream, or async iterator
all i want to do is implement the postgresql wire protocol, i implemented asynciterator, stream, future, nothing works to poll more than one time with executor::block_on and "await" on the future, go figure,
Async functions - too high level, no control over pending (i.e. doesn't actually work)
Poll functions - seems to only run once, return pending, then hang forever (i.e. doesn't actually work)
AsyncIterator/Stream - many competing traits doing similar things, unclear how they work because very few examples, requires nightly stuff, even with the nightly stuff on, doesnt work
Must be a skill issue but dipping my toes into async rust has ruined my preceding week because there's like 50 billion different blogs about how async could be done differently / better in the future but no real great guidance on how to do it correctly right now.
Call me crazy, but "impl Future" and "block_on" should ...just work, no runtime needed, but sadly they just don't actually work,
How do we have no standard Runtime trait? You wonder why there's a bunch of conflicting runtimes and every async crate just gets sucked into the tokio ecosystem, it's because there's no Runtime trait to standardize the functionality of a runtime.
IMHO avoiding async rust is desireable because it's a utter mess and bloats your compile time a ton, but if you need to do I/O there is little choice, if you need to use postgresql there is no choice, even the sync library for postgres depends on async. Surely there's a sync way to get at async, surely "await" means "poll until NOT pending" right?
anyway, no expectation for a reply, just feeling compelled to voice my outrage the current state of async rust is considered acceptable by anyone, this is midwit territory for sure, we have overcomplicated it, how do we make async rust more fun and accessible and "just works" ?