3 ms·
Ryan Dahl seemed to imply that promises were a necessary pre-requisite for async/await. https://medium.com/@imior/10-things-i-regret-about-node-js-ryan-dahl-2ba
by notus 8y ago
Ryan Dahl seemed to imply that promises were a necessary pre-requisite for async/await. https://medium.com/@imior/10-things-i-regret-about-node-js-ryan-dahl-2ba71ff6b4dc https://medium.com/@imior/10-things-i-regret-about-node-js-r...
I don't have the actual transcript so summarizing based off of someone else's comments:
* I added promises to Node in June 2009 but foolishly removed them in February 2010.
* Promises are the necessary abstraction for async/await.
* It's possible unified usage of promises in Node would have sped the delivery of the eventual standardization and async/await.
* Today Node's many async APIs are aging badly due to this.
- manigandham 8y agoAsync/await is just syntactic sugar in languages. It's always implemented by some kind of promise/futures/task based API, itself usually built on some kind of state-machine/iterator/generator model.
- mikeryan 8y agoPromises could be shimmed in browser JS (Jquery was my first experience with it) where async/await needed something like a babel/webpack transpiler for the syntax to really be feasible in a browser.