Re:SSH2 client written in pure JavaScript for node.js
by ibotty on Monday November 12, 2012 @07:13AM
(#4772504)
i am familiar with erlangs ports. why shouldn't the same work for node?
(and btw: cryptography might take a big computational chunk. it's hard to write cpu-intensive stuff in node's callback style. but i guess the person(s) doing it will sort this out.)
Re:SSH2 client written in pure JavaScript for node.js
by davidw on Monday November 12, 2012 @10:47AM
(#4773247)
I'm just explaining one motivation for wanting to be "pure". Node could certainly do something like what Erlang does. Erlang has, in the past, also gone the 'pure' route. IIRC, they had their own slow/limited regexp implementation, for instance, so that it'd run in the VM and not block.
Re:SSH2 client written in pure JavaScript for node.js
by ibotty on Monday November 12, 2012 @09:50AM
(#4773009)
oh. and erlang is not event-loop based. it has preemptive multitasking for its threads. so it is not as necessary in erlang than it is in node.
Re:SSH2 client written in pure JavaScript for node.js
by davidw on Monday November 12, 2012 @10:27AM
(#4773161)
Being multi-threaded is a relatively recent thing for Erlang. And IIRC, it only starts enough of them to cover all the system cores.
It has preemptive multitasking for its "processes", but seeing as how those are all in the same Unix process, and time is allocated to them via Erlang's own virtual machine, calling out to something in C that blocks would be a problem for Erlang.
Erlang, at a basic level, is event based, and this kind of protection is necessary.
I imagine that Node faces a similar problem with "untrusted C code".