James Duncan: Node, in some ways, has a similar view: it’s all asynchronous-based programming, all asynchronous IOs. Where it steps away from what Erlang is doing is that it explicitly says, “You shall run as one process.” You get one CPU to play with. What we’re going to see inside the Node space is some capability to have messaging between CPU cores and, therefore, Node processes running on different CPU cores. I don’t know if anyone’s going to go to the same extreme as Erlang, but some of the things Node is doing are similar.
To understand why this is misleading, we need to go over some background information. Erlang popularized the concept of lightweight processes (Actors) and provides a runtime that beautifully abstracts the concurrency details away from the programmer. You can spawn as many Erlang processes as you need and focus on the code that functionally declares their communication. Behind the scenes, the VM launches enough kernel threads to match your system (usually one per CPU) and has event-driven context switching (epoll/kqueue) built in. It also abstracts away the details of communication, so communication between processes on the same machine is identical to communication between processes over a network. Essentially, you can write event-driven, asynchronous Erlang code without having to worry about what blocks the system and how to connect CPUs (locally or over a network).
It’s worth pointing out that I am in no way affiliated with either language, and I certainly don’t think Node.js is completely a bad thing. Enabling people to code in more ways than before is always great, and I certainly respect the project. But, the people involved should be straight about the fact that their system is an approximation of what Erlang provides. It’s not “in some ways, a similar view.” Instead, it’s the same view, just executed in a different language that doesn’t support event-driven I/O natively.
- darkcl reblogged this from ankurgoyal
- mildredbod8 likes this
- nhmortgagebroker likes this
- pdfsearch likes this
- mamortgageexpert likes this
- webfront reblogged this from ankurgoyal
- tooepic likes this
- ngensoft likes this
- seoway likes this
- bitsbooksbikes likes this
- jonpaullussier reblogged this from ankurgoyal
- ankurgoyal posted this