Open
Description
Summary
This is a documentation only issue.
The Nim for TypeScript Programmers is great but is currently missing information about the similarities between Nim's Future
s and TypeScript/JavaScript's Promise
s, as well as how asynchronous functions behave.
Description
Here is a table I've compiled of Nim asyncfutures
features and their respective JavaScript counterparts:
Nim | TypeScript/JavaScript |
---|---|
Future[T] |
Promise<T> |
newFuture[T] |
new Promise<T>() |
complete |
Promise.resolve() |
fail |
Promise.reject() |
addCallback |
Promise.prototype.then() |
`and` |
Promise.all() |
`or` |
Promise.race() |
all |
Promise.all() |
Additional Information
The above information only mentions Promise
s, not any of the behavior with asynchronous functions, which do not behave identically to functions that return a Promise
. I don't know enough about Nim's async
pragma to write about that.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo