Hacker News new | ask | show | jobs
by imagist 3481 days ago
> It's 2016 and there are many well documented and widely adopted solutions arising from external libraries and developments in ECMAScript.

"Solutions" is a strong word for what's available in JavaScript. Promise hell isn't better than callback hell, it's just horrible in slightly different situations. To make matters worse, it seems that many JS libraries have just wrapped the old callbacks in promises, meaning that we end up using promises in situations where a callback would actually be easier (because that's how it was originally written).

None of this comes close to the ease of threads in Erlang.

1 comments

With async/await (currently available and pretty stable in node, you just need the --harmony flag. You can also compile to it pretty effortlessly) you basically get the exact same code style you get in Erlang/Haskell/Other threaded models but with delicious event loop goodness.
Not only is Erlang's and Haskell's threading model unlike async/await, but Erlang's threading model is unlike Haskell's. So I'm just not sure what you're taking about.
I meant the coding style, not the threading model. Like the author talks about, one of the nice things about the threaded languages is that you basically just write normal, synchronous looking code and get asynchronous results. async/await lets you do basically the same thing.