2 ms·
I very much like this model, but I wonder how necessary it is when we have IcedCoffeescript [1], ES6 generators + co [2], and ES7 async/await [3] as viable ways
by acjohnson55 11y ago
I very much like this model, but I wonder how necessary it is when we have IcedCoffeescript [1], ES6 generators + co [2], and ES7 async/await [3] as viable ways of managing async control flow within mostly synchronous-looking code, all as dialects of languages that have strong adoption.
I actually think generators + co is a really strong model. Async/await gives you a slight bit of sugar, but I've realized that if you stick with generators, you can wrap your generators to allow you to `yield` more than just promises, effectively giving you something like (untyped) scoped continuations [4].
[1] https://maxtaco.github.io/coffee-script/ https://maxtaco.github.io/coffee-script/
[2] https://github.com/tj/co https://github.com/tj/co
[3] http://masnun.com/2015/11/11/using-es7-asyncawait-today-with-babel.html http://masnun.com/2015/11/11/using-es7-asyncawait-today-with...
[4] http://blog.paralleluniverse.co/2015/08/07/scoped-continuations/ http://blog.paralleluniverse.co/2015/08/07/scoped-continuati...