4 ms·
I am not an expert on Node. But IIRC, Dahl tried and rejected a coroutine style for Node. The problem was that context switches that may or may not happen ins
by corysama 16y ago
I am not an expert on Node. But IIRC, Dahl tried and rejected a coroutine style for Node. The problem was that context switches that may or may not happen inside of any function that you call end up creating consistency problems that are almost identical to the thread-safety issues that he was explicitly trying to avoid by creating Node.
- beagle3 16y agoDo you have pointers for that? That really surprises me, as the two are essentially equivalent, except that function closures as in Node introduce a new, restartable (usually an unwanted/unexpected featture) scope, and coroutines maintain the same scope. Thread safety problems are all about data changing in between your statements due to some other threads. Coroutines make that happen only along calls to other routines, which is very disciplined.
- DTrejo 16y agoBy the way, node is built on V8. I get the impression that Ryan is not at all interested in inventing a new language. He is interested in a language that runs quickly. Anything outside of the scope of JS run on V8 inches into the "new language" designation. Basically, any syntax you couldn't use in the browser is a no-no. Note: this is just my impression.
- beagle3 16y agoLua under LuaJIT2 is way faster, _and_ has real coroutines. Shame about the browser requirement.
- corysama 16y agoI've gotta run. So, I can't verify that this is really a pointer... but this summary http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.javascript/2010-05/msg01501.html http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.javas... about this video http://developer.yahoo.com/yui/theater/video.php?v=dahl-node http://developer.yahoo.com/yui/theater/video.php?v=dahl-node mentions "He's also agains the use of co-routines because they're too hard"