Will node web employees block erlang?

I'm curious if Erlang can be killed by Node.js, which can be extremely popular, fast and web workers . Is it possible? Why?

But what about multiprocessor concurrency? Don't need threads to scale programs to multi-core computers? Processes are needed for multi-core computers, not memory streams. the basics of scalable systems fast network and non-blocking design - the rest is messaging. In future versions, Node will be able to fork new processes (using the Internet Workers API) that fits well with the current design.

+4
source share
3 answers

Node.js and Erlang are completely different animals on the savannah.

Examples:

Node.js is centered around a collaborative multitasking model reminiscent of Python Twisted or Rubys EventMachine. Erlang, by contrast, is a proactive multi-tasking system consisting of planners, etc.

Node.js implements JavaScript, which is a prototype-based OO language with an imperative base and several functional ideas. Erlang implements, in essence, an extended lambda calculus in the usual functional style.

Node.js is mainly centered around one machine, where each request is processed in order. Inbound web workers and the multi-node extension allow all machine processors to be used. Erlang is designed to seamlessly integrate multiple nodes that are intended to be used so that a cluster of (more than one) physical Erlang devices can easily interact with each other.

Node.js takes the usual proactive troubleshooting position found in most languages. Erlang, on the other hand, takes a proactive troubleshooting approach: the system is built to survive, even if errors occurred that were not addressed. In the worst case, letting the other physical machine take over.

Node.js is heavily dependent on JIT to get speed. Erlang is a more standard compiled language. The ramifications are that Erlang may be better suited for soft-realtime, since the wall hours of the code are usually more predictable.

Discussion:

It should be clear to you that the approach to the proposed problem is very different from the two languages. Therefore, it is probably worth taking care of both for this reason. In other words, I do not think that one language will completely replace another. Node.js has the power of dating. Erlang has a distinct power wrt reliability.

disclaimer: I hack Erlang.

+16
source

Not quite likely.

  • With JS volatile data structures, there are many more ways to shoot in the leg while processing shared data.
  • Erlang solutions can be easily and transparently grouped; node.js does not seem to provide comparable support.
  • Erlang VM seems to provide more tools for working with running systems.
  • Erlang is compiled statically and has some support for static input; this usually improves reliability.
  • V8 is fast only because of JIT, and JIT often consumes a lot of memory. Erlang VM is likely to handle more workloads with the same CPU and memory budget.

Node.js certainly has a number of problems, but none of them seem to be going to oust Erlang from his place. I hope node.js supersedes PHP instead :)

+5
source

Node.js is the answer to the question "How do you create an effective parallel system by fixing a series of events in a language with a ridiculous number of lines of code." And the question itself is also brilliant.

Erlang is a much more complete answer to the concurrency problem, language, compiler, libraries, everything is built on fault tolerance, distribution and concurrency from scratch.

A complete list of Erlang benefits? This is a long list, I do not have much time. A few samples:

  • one lightweight, scalable concurrency mechanism (processes), not lightweight (events) plus heavyweight (web workers)
  • Supervisor hierarchies between processes
  • soft real-time capabilities (due to language design, compiler and runtime support)
  • processes support a call stack, events in node.js forget where they come from, which makes error messages / stack traces much less insightful
  • No need to insert parentheses / indents in the continuation style to create callbacks, the event loop and the continuation of the transfer are controlled by the compiler / runtime

Node.js has the clear advantage of using JavaScript, so it will probably beat Erlang in terms of popularity wherever node.js is good enough, which is in many places.

+4
source

Source: https://habr.com/ru/post/1333513/


All Articles