Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Futures and promises block the derefing thread. Once that is somewhat mitigated by notifying promises, we then get callback hell and inversion of control. These issues The same issues exist in Javascript. These issues were addressed by F#, and later C# async/await, the latter of which has been copied by Scala. The same issues exist in Javascript. 

Proposal

Copy C# async/await. (async ...) establishes a block, within which (await a-future-or-promise) will relinquish control, wiring up a state machine representing the rest of the block to the notification of the future/promise. The async block itself returns a promise.

...