Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will node's web workers detronize erlang? [closed]

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.

like image 245
Rafał Sobota Avatar asked Dec 27 '10 22:12

Rafał Sobota


1 Answers

Node.js and Erlang are quite different beasts on the savannah.

Examples:

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.

Discussion:

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.

like image 190
I GIVE CRAP ANSWERS Avatar answered Nov 15 '22 00:11

I GIVE CRAP ANSWERS