3 ms·
I used Python's Twisted framework back in 2008 or so. This is before any language had async / await keywords (of course, the concept was there, just not the syn
by Buttons840 3y ago
I used Python's Twisted framework back in 2008 or so. This is before any language had async / await keywords (of course, the concept was there, just not the syntax level support).
Twisted built async on top of Python's generator functions, as far as I understand. I see now that the Rust community talks about supporting generators, and I've wondered if Rust did things backwards. If Rust had received generators first, could async have been built on top of generators without async specific special syntax?
- pornel 3y agoRust had generators first and used them to experiment with async. They're still there, stuck in nightly/unstable. https://doc.rust-lang.org/beta/unstable-book/language-features/generators.html https://doc.rust-lang.org/beta/unstable-book/language-featur... I think that's because there was a huge demand for async specifically, and Rust could ship higher level async without solving all the design details of less desired generators first.
- Buttons840 3y agoI didn't know that, thanks for telling me.