Of course it is! This is where the current implementation of generators had started from.
Some, but not that much, actualy. If there had been an extensive discussion of error messages, I must have missed it.
The async/await RFC just says that “we will want dedicated syntax for async functions, because it is more ergonomic & the use case is compelling and significant enough to justify it”.
Originally, my position was that #[async] on top level functions is not even desirable, as hiding the “outer” return type and construction of generator closure from users only muddies the waters and impedes learnability.
If we’d started explaining at the other end, i.e. with the Future trait, and then said “BTW, here’s a macro that generates the boring bits for you”, I think it would go over much smoother.
Depends on what you call a problem. If there’s no problem, then why are we talking about extending syntax with stuff like async(Send), and how are we going to have both async fn and fn ... -> impl Future in parallel, - because the former is not as expressive as regular Rust syntax?
ISTM, that Unpin is just as applicable to generalized coroutines as it is to async fn's. And final design for resume arguments could have been postponed just as it’s been now.
Yes, and we’d have solved (or postponed them) in the same way.
I am wondering (uneasily), what's going to happen when you finally get to design other applications of coroutines such as iterators. Are we in for another bout of keyword addition, because `async` was not general enough? Are we going to have to solve the self-referentiality problem all over again?
I think that first version of async IO in Rust should be shipped with just macros as surface syntax, implementation bits staying completely in the unstable land. And I think there’s a fair chance that it’ll grow on people and they’ll realize that dedicated async/await syntax isn’t even needed in Rust.