Open nikomatsakis opened 2 years ago
Maybe something like "action" or "microtask"? Not sure how that sounds in English.
I've always been unsure of what exactly "thunk" means. I haven't heard much confusion about the term future in Rust, but what about "promise"? It must be the most common word for this type of thing since js uses it, and it is not parallel.
Though also if we assume dada users will often come from rust, there's something to be said for using rust terminology, just like with rust there was always a decision about whether to use established terms from languages like c++ and js.
I've heard confusion in talking to folks at AWS, caused I think by Java's terms. They pointed out that Rust's future is closer to Java's Callable
. I may be over-rotating on this feedback. I do genuinely feel the term is a bit confusing -- promise is maybe better, yes. Hmm.
I decided to move away from the Rust term
Future
after hearing a number of people get confused about it. For one thing, the normal use of the termFuture
involves a parallel process, and in Rust that's not the case. I think that thunk is accurate enough, but not widely used and perhaps confusing (though kind of fun to say). I find myself not wanting to use it in error messages.I am wondering if "suspended function" would be a better term? Or perhaps "suspension"? (I think Kotlin uses a similar term, actually, and perhaps even avoids the keyword
await
.)The idea would be that when you call an
async fn
, it immediately suspends execution until it is awaited, and what you get back is a "suspended fn".