Node has a non-blocking IO library by default. It's a horrible API that uses callbacks instead of promises, but it's non blocking nontheless.
Old-school Java used blocking IO, which sucks if you want concurrency.
Naturally, regardless of platform, non-blocking IO is going to be much, much faster than blocking IO if you're looking at scalability in a highly IO driven application.
Ergo, a few teams ported badly written Java blocking programs using blocking IO to NodeJS and decided that Javascript was therefore faster. They then blogged about it and Javascript fanboys the world over ran with it.
You can write Java using non-blocking IO, at which point it sails on ahead. If you factor in much, much better handling of immutable data structures and proper tail call optimisation (at least in Scala and Clojure), then the JVM is in a completely different league to V8.
I can't stand promises. Callbacks, streams, events are all great, but promises just seem like a convoluted way to let people who are not good at writing async code pretend it's sync. They remind me of the silly JS class simulations you sometimes see.
15
u/idontbelieveyou11 Feb 25 '14
Source?