Re:Node.js, a popular tool for building modern internet serv...
by notduncansmith on Friday December 05, 2014 @04:05PM
(#8706888)
If you want to get out of callback hell, I Promise you'll enjoy this library called Bluebird.
Re:Node.js, a popular tool for building modern internet serv...
by justplay on Saturday December 06, 2014 @04:43AM
(#8708821)
`Bluebird` looks good, i gonna try it out. thanks.
Re:Node.js, a popular tool for building modern internet serv...
by jerf on Friday December 05, 2014 @02:56PM
(#8706507)
Thing is, if you want Go- or Erlang-style piping of data, well, Erlang and Go are right there... and both written from day 1 to support those use cases, rather than bodging them onto a language ten years later....
So I'm wondering if Node.js, Io.js or both will embrace coroutines, yield and generators. The real danger of threads was always shared memory, not so much simultaneous execution. I'm hoping that we'll start to see Go, Erlang and even shell-style piping of data through predictable, testable and debuggable threads of execution begin to replace callbacks.
If anyone has a general approach for converting callbacks to use coroutines and yield in Javascript, I'd be very eager to hear it. Also the problem of how to enforce scope in Javascript, to prevent sharing state between coroutines.