4 ms·
Rust does this, if you don’t call await on them. You can then await on the join of both.
by steveklabnik 1y ago
Rust does this, if you don’t call await on them. You can then await on the join of both.
- sedatk 1y agoIs the "join" syntax part of the language?
- tcfhgj 1y agono https://doc.rust-lang.org/std/future/macro.join.html https://doc.rust-lang.org/std/future/macro.join.html
- sedatk 1y agoThen it doesn’t apply in this case.
- tcfhgj 1y agowhy?
- sedatk 1y agoBecause parent asked for a language feature, not runtime: "One thing that most languages are lacking..."
- tcfhgj 1y agoI haven't linked a runtime but the specific feature, which alleviates manual handling of multiple futures when awaiting multiple futures concurrently, expressed in the language named Rust.
- deathanatos 1y agoWhy is having it be syntax necessary or beneficial? One might say "Rust's existing feature set makes this possible already, why dedicate syntax where none is needed?" (…and I think that's a reasonably pragmatic stance, too. Joins/selects are somewhat infrequent, the impediments that writing out a join puts on the program relatively light… what problem would be solved? vs. `?`, which sugars a common thing that non-dedicated syntax can represent (a try! macro is sufficient to replace ?) but for which the burden on the coder is much higher, in terms of code readability & writability.)