News for hackers. Stuff that matters.
Re:Node v4.0.0 by spion on Tuesday September 08, 2015 @09:37PM (#10189195)
Now that we have ES6 generators, this is much less of an issue.
Re:Node v4.0.0 by spankalee on Tuesday September 08, 2015 @10:46PM (#10189401)
Generators don't help with the sync/async split.

Generators are just iterators, and are synchronous. The consumer asks for a value with next() and the value must be computable (even if that value is a Promise).

If you have an async function (one that returns a Promise or in the future a Stream), and you need to call it from a sync function, and somehow incorporate the future value into the return value of the sync function, you're stuck. You have to async-ify your functions all the way up the call chain.

With blocking this isn't a problem. We just need environments that make blocking cheap.

Re:Node v4.0.0 by spion on Wednesday September 09, 2015 @05:54AM (#10190565)
In my experience in practice there is no big difference, really, its just a matter of a few keywords.

As for "having to change an entire call stack", that just stopped happening after a while. The rule of thumb was that if the function is impure (e.g. relying on mutable state) then it will likely become async, too. That lets me plan ahead.