Indeed, I'm surprised the author doesn't know about them (or atleast doesn't mention them). Especially since even the async-await strawman (the first thing you'd find when googling for async-await in JS) demonstrates an implementation via generators...
https://github.com/srikumarks/cspjs - The readme has benchmarks from bluebird generators. It is only 74 ms slower than the sweet.js solution. So the author knows.
Look at the author's post on using promises. The author does not understand promises very well yet.
Generators are up there with the let keyword in the list of "things I wish I had (native) access to already" because there's just so many use cases for them. This is definitely one combination I haven't thought of before though, so thanks for bringing it up!
Is this similar to the co utility? I've been using it to yield partially-applied node calls directly, no promises required.
var text = yield fs.readFile.bind(null, '/file.txt')
Yes, it's similar, `Promise.coroutine` is faster and a stronger abstraction though, especially with `addYieldHandler`.
They work together beautifully, i wrote this little prototype/promise helper for node (https://github.com/icodeforlove/node-promise-object#deferred...). And it removes all of the boiler plate associated with using promises, and generators (if you're ok with argument stuffing).
yes generators can help you control the flow as you do async programing, but you can't use generators to do something like an ajax function which gives you an async value, you'd need promises or something for that, generators allow you do use those async function is a more natural way.
Promises _are_ an async value. By yielding promises you're doing exactly that :)
Generators dont give you async programming capabilities.You need a library that actually wraps generators into coroutines,and then wrap async functions into "thunks" to make it work.