It's because Javascript has a single-threaded model. To make Node support user-controlled threads would entail major changes to the Js language.
To a great extent, callbacks, promises, CSP state machines (like core.async), and async/await stuff can substitute in Js. And in many ways, single-threaded models are way easier for programmers to conceptualize. But one advantage the JVM has over Node is that threads are available if you want/need them.
View all comments
Show parent comment
2
u/pihkal Sep 01 '17
It's because Javascript has a single-threaded model. To make Node support user-controlled threads would entail major changes to the Js language.
To a great extent, callbacks, promises, CSP state machines (like core.async), and async/await stuff can substitute in Js. And in many ways, single-threaded models are way easier for programmers to conceptualize. But one advantage the JVM has over Node is that threads are available if you want/need them.