I'm curious if Erlang could be killed by Node.js which could be extreme popular, fast and have web workers. Is it possible? Why?
But what about multiple-processor concurrency? Aren't threads necessary to scale programs to multi-core computers? Processes are necessary to scale to multi-core computers, not memory-sharing threads. The fundamentals of scalable systems are fast networking and non-blocking design—the rest is message passing. In future versions, Node will be able to fork new processes (using the Web Workers API ) which fits well into the current design.
Node.js and Erlang are quite different beasts on the savannah.
Node.js is centered around a cooperative multitasking model, reminiscent of Python Twisted or Rubys EventMachine. Erlang, on the contrary, is a preemptively multitasked system complete with schedulers and so on.
Node.js implements JavaScript which is a prototype-based OO language with an imperative base and several functional ideas. Erlang implements, essentially, an augmented lambda-calculus in the usual functional style.
Node.js is centered mostly around a single machine, where each request is handled in order. The coming Web workers and the multi-node
extension let you use all CPUs of the machine. Erlang is designed to seamlessly integrate multiple nodes, which are meant to be used to let a cluster of (more than one) Erlang physical machine be seamlessly communicating to each other.
Node.js takes the usual stance of proactive fault-mitigation found in most languages. Erlang on the other hand takes a reactive fault-mitigation stance: the system is built to survive even if errors otherwise unaccounted for occur. In the worst case by letting another physical machine take over.
Node.js relies heavily on JIT to obtain speed. Erlang is a more standard compiled language. The ramifications is that Erlang may be better suited for soft-realtime as the wall-clock time of a piece of code is usually more predictable.
It should be clear to you that the approach to the proposed problem is vastly different from the two languages. Hence, it is probably worth keeping both around for this very reason. In other words, I don't think one language will completely replace the other. Node.js has a familiarity strength. Erlang has a distinct strength w.r.t. robustness.
disclaimer: I hack Erlang.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With