News for hackers. Stuff that matters.
Re:Show HN: Async/await alternative by vsviridov on Monday October 31, 2016 @04:39AM (#12835051)
Node 7 is out with async/await behind the flag.
Re:Show HN: Async/await alternative by zamalek on Monday October 31, 2016 @09:47AM (#12836626)

    // the stream has now been fully read, async in the background
What if the file is gigabytes in size?
Re:Show HN: Async/await alternative by bruno2223 on Monday October 31, 2016 @11:52AM (#12837917)
Then you simply do not use this module :-)

Unless you have Time and RAM to waste.

Re:Show HN: Async/await alternative by skybrian on Monday October 31, 2016 @08:56AM (#12836268)
It's a nice trick but it's unsafe in general. JavaScript libraries usually assume single-threaded event handling. If you start up another event loop from a callback (while some other library's code is already on the stack), you'll probably break it.
Re:Show HN: Async/await alternative by maxpert on Monday October 31, 2016 @12:12AM (#12834251)
Well I hope NodeJS ultimately settles on such a syntax to preempt and resume automatically. I love Golang in this regard since it abstracts out everything using channels, and go-routines (not to compare multiple thread support).
Re:Show HN: Async/await alternative by aaronhoffman on Monday October 31, 2016 @08:03AM (#12835975)
Love the simplicity. Wish it was powered by RxJS https://github.com/Reactive-Extensions/RxJS
Re:Show HN: Async/await alternative by bbcbasic on Monday October 31, 2016 @02:30AM (#12834676)
Looked at the deasync that this is based on, and it looks like they are trying to reinvent threads? Seems ironic to me.
Re:Show HN: Async/await alternative by jjnoakes on Monday October 31, 2016 @08:25AM (#12836078)
Why do you think they are trying to reinvent threads? Looks to me like it is a basic nested event loop.
Re:Show HN: Async/await alternative by bbcbasic on Monday October 31, 2016 @05:08PM (#12840941)
It pauses execution of a stack when it is blocked allowing other stacks to execute.