News for hackers. Stuff that matters.
Re:Node 5.7.0 (stable) released by esailija on Friday February 26, 2016 @06:47AM (#11180931)
coroutines with generators are more powerful (cancellation, automatic resource cleanup when the generator terminates etc) and have worked for a long time out of the box. The only difference is that you write `yield` instead of `await` and `decorator(function*` instead of `async function`
Re:Node 5.7.0 (stable) released by phpnode on Friday February 26, 2016 @07:42AM (#11181061)
Babel can transform async functions into Bluebird coroutines, so the best of both worlds - https://www.npmjs.com/package/babel-plugin-transform-async-t...
Re:Node 5.7.0 (stable) released by esailija on Friday February 26, 2016 @07:51AM (#11181089)
Yes but with this you lose the powerful features I just mentioned: automatic resource cleanup[1], cancellation, yield handlers.. don't you?

1. https://github.com/petkaantonov/bluebird/issues/1014

Re:Node 5.7.0 (stable) released by phpnode on Friday February 26, 2016 @09:17AM (#11181444)
No I think those should work with async functions as it is literally just translating `async` -> `yield`, but worth investigating.
Re:Node 5.7.0 (stable) released by alfonsodev on Friday February 26, 2016 @08:16AM (#11181173)
Thanks for commenting on that, I didn't think about those issues. I'll research on how much impact could have on performance. In the other hand I believe syntax is not the only difference. I'm not full time js dev, but after a quick search, I found Domenic pointing 4 differences here https://esdiscuss.org/topic/does-async-await-solve-a-real-pr...
Re:Node 5.7.0 (stable) released by esailija on Friday February 26, 2016 @08:55AM (#11181335)
These seem to be mostly about undecorated generators. 3. Is a legit difference but it is actually a syntax error to do yield 1 + yield 2. So that is fixable in a backward compatible way.
Re:Node 5.7.0 (stable) released by mtzaldo on Friday February 26, 2016 @08:17AM (#11181176)
Could you put a reference for the decorator/yield usage? Thanks
Re:Node 5.7.0 (stable) released by esailija on Friday February 26, 2016 @08:45AM (#11181295)
Re:Node 5.7.0 (stable) released by mtzaldo on Friday February 26, 2016 @09:51AM (#11181631)
Thanks, I will review it.
Re:Node 5.7.0 (stable) released by l1ambda on Friday February 26, 2016 @11:21AM (#11182192)
https://github.com/llambda/koa-boiler/blob/master/app.js#L75 is an example of Bluebird coroutines paired with Koa.