Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The article is a well written, well illustrated guide to programming under Javascript using an event loop, callbacks, etc.

Which I personally find awkward to do in 2017 where the OS or the language runtime should give me better concurrency facilities.



And there are runtimes that do that, like Erlang's BEAM. At least Node concurrency is a step in the right direction, as it's much easier to reason about than threads on the JVM.


JS is just introducing threads with shared state right now. Node concurrency is now as easy to reason about as JVM concurrency.

Except, on the JVM, all these issues were solved years ago, and we nowadays have amazing libraries to deal with all the issues for us.


There is a proposal for shared memory and atomics, which are absolutely opt-in at the moment. You can easily use the event loop if you don't need parallel processing.


And you can use an event loop in Java today if you want, the question is more about library support.

And that is certainly changing in both alnguages now, in Java towards promises, in JS towards threads.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: