3 ms·
This seems to be comparing apples to oranges. Node.js is a way lower-level tool than erlang and with it come the advantages of programming close to the next low
by jhuckestein 15y ago
This seems to be comparing apples to oranges. Node.js is a way lower-level tool than erlang and with it come the advantages of programming close to the next lower layer in your stack (in this case syscalls) and less potential for error in node.js itself.
I think people are working on things similar to erlang that are built on top of node.
- silentbicycle 15y agoWould you mind fleshing out the "and less potential for error in node.js itself" part of your comment? I don't really understand what you mean. I get the impression that error handling in node is handled the same way as managing control flow - you're directly managing the continuation of every potentially blocking / failing event. Erlang's "let it crash" / distributed hierarchy of supervisors error-handling style is IMHO one of its most interesting characteristics; I can't see how it could be grafted on node.
- jerf 15y ago"Node.js is a way lower-level tool than erlang" What on Earth are you talking about? Erlang is a language/VM combo (it's hard to separate the two), with nothing else between it and the OS. Node sits on top of a VM not really intended for what it is being used for, so Node has another layer between it and the OS. And the programming style engendered by Node.js is the single most bug-ridden programming style I know, for all its other features. Manually-chopped-up asynchronous callback based programming is a terrible paradigm for code reliability. Erlang is also unparalleled in general for its error handling. I can't even think of another environment that even has a story equivalent to Erlang's cross-cluster supervision trees built in to the core libraries themselves, let alone one with over a decade of refinement.
- silentbicycle 15y agoI think by "lower-level" he means "having to manage resources by hand that could be handled automatically", not "close to the OS".
- jhuckestein 15y agoThank you. Put another way, nodejs (except than the VM, granted) has less magic than erlang. At least it seems that way to me having looked at erlang for no more than a few hours and using nodejs every day, so take this with a grain of salt :)
- silentbicycle 15y agoIt wasn't a compliment. :) Erlang has a scheduler which automatically makes intelligent tuning based on dataflow in ways that are realistically impossible for anybody to do managing callbacks by hand. They aren't "magic", they just take into account a fairly simple cost-per-action model ("reductions") and whether a process is active, has messages to process, or is blocking with an empty mailbox.