-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
rename "promise" to "future" (or "fncall"?) #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If I might add to the discussion, I would make the following distinction:
So I would say that coroutines (as To sum this up, control flow is the means/process that allows for the production of the value, and is more appropriate to denote the sequence of actions than the result. There's a Wikipedia page about Futures and Promises which I hadn't read before, which contains a lot of references. I'm not sure what the introduction is worth though as the only reference for futures comes from Scala, which is definitely not a historical pioneer for the term. |
Just my 2c, I think ideally you'd want separate entities for the promise (a future result) and the task (resume and cancel). Also might be nice to take into account some future design for streams, just so the semantics of a stream-that-only-yields-once looks / behaves much like a promise+task combination EDIT: All these damned words are so overloaded 😂😭 |
+1 for the streams -- they're similar to futures but can have multiple different values. Iterators are conceptually similar but usually don't have an abstraction that share traits with future, while they probably should. |
They're now called "frames" and can be the frame of a normal blocking function or the frame of an async function. This issue obsoleted by the merge of #3033. |
Somebody suggested this and I think it might make sense.
Right now when you make an
async
function call, you get apromise->T
. You can implicitly castpromise->T
topromise
.await
works onpromise->T
resume
andcancel
works onpromise
suspend
gives you apromise->T
It's kind of weird to "resume a promise" and "cancel a promise". It makes a little more sense to "resume a future" and "cancel a future".
This proposal is to change "promise" to "future". Another contender might be "coro" (short for coroutine). Another idea that I just made up is "fncall". It makes a lot of sense to "resume a fncall", "cancel a fncall", "suspend a fncall", and nobody is going to use
fncall
as an identifier.The text was updated successfully, but these errors were encountered: