←back to thread

289 points kristoff_it | 2 comments | | HN request time: 0s | source
Show context
raluk ◴[] No.44609651[source]
One thing that most languages are lacking is expressing lazy return values. -> await f1() + await f2() and to express this concurently requres manually handing of futures.
replies(3): >>44609880 #>>44610056 #>>44610348 #
sedatk ◴[] No.44609880[source]
Which languages do have such a thing?
replies(2): >>44610179 #>>44610709 #
steveklabnik ◴[] No.44610709[source]
Rust does this, if you don’t call await on them. You can then await on the join of both.
replies(1): >>44610738 #
sedatk ◴[] No.44610738{3}[source]
Is the "join" syntax part of the language?
replies(2): >>44611332 #>>44613040 #
tcfhgj ◴[] No.44611332{4}[source]
no

https://doc.rust-lang.org/std/future/macro.join.html

replies(1): >>44612037 #
1. sedatk ◴[] No.44612037{5}[source]
Then it doesn’t apply in this case.
replies(1): >>44615353 #
2. tcfhgj ◴[] No.44615353[source]
why?