3 ms·
How much longer until async/await is as easy to use as it is in JavaScript?
by MuffinFlavored 8y ago
How much longer until async/await is as easy to use as it is in JavaScript?
- swsieber 8y agoSeveral releases at the minimum. The futures API has been stabilized for 1.36, but the async/await call syntax is still unstable (from what I understand). Even then, there will still be more friction in rust compared to javascript, since there is just more to make decisions about (e.g. ownership, it's generally lower-level, etc.) To see a full status on async stuff in rust, see https://areweasyncyet.rs/ https://areweasyncyet.rs/ Edit: There will be a ton of churn as well in the eco-system since everybody will need to move to the new api, but there are api shims that let you use the new stuff on the old stuff, so that makes it a little easier. There's going to be a ton of _visible_ progress this year.
- inamberclad 8y agoasync/await still scares me a little since I would prefer that the language core stay small and universal.
- nemothekid 8y agoasync/await is sooo much easier to use than combinators though. I struggle in remembering when I should be using and_then/or_else/map/then, and then juggling all the references as things pass into and out of closures. I wrote a small redis clone with async/await and it was a joy to write. It was fast and so easy to reason about. It's so worth it to add it to the core language.
- jerknextdoor 8y ago`async`/`await` syntax hasn't been implemented. `std::future` will be stabilized in 1.36. It will be a decently long time until it's as "easy to use as it is in JavaScript". You can follow the progress here: https://areweasyncyet.rs/ https://areweasyncyet.rs/
- estebank 8y agoI would say that a realistic target for being able to use async/await in general projects using the stable compiler is the end of the year. Any earlier than that you will be able to use it, but you'll be in the same situation as today: fragmented ecosystem (0.1/0.3/std futures split), incomplete or missing features, missing syntax (await/async for loops/etc.) and subpar diagnostics. Things are slowly but surely coalescing into a nice story, but right now the people that are excited are going off potential more than what is already there, as interesting as many of the individual pieces are.
- kod 8y agoYears, plural.