News for hackers. Stuff that matters.
Re:Clojure's edge on Node.js by ericb on Thursday July 08, 2010 @11:21AM (#1497617)
I'm not familiar with node.js. What engine is used to run the stand-alone JS? Is it inevitable that is it limited to a single core?
Re:Clojure's edge on Node.js by ionfish on Thursday July 08, 2010 @11:25AM (#1497635)
Node uses Google's V8 virtual machine, which they built for Chrome. JavaScript is single-threaded, so yes, unless you spawn a child process it'll be limited to a single core.
Re:Clojure's edge on Node.js by ericb on Thursday July 08, 2010 @02:01PM (#1498190)
Is being single-threaded part of the JavaScript spec?
Re:Clojure's edge on Node.js by ionfish on Thursday July 08, 2010 @03:35PM (#1498508)
Only implicitly: no threading model is documented in the ECMAScript Language Specification [1], and no widely-used interpreter implements threading. The new Web Workers specification adds something like threading to JavaScript in the context of the browser [2], and Node intends to add support for this on the server as well [3]. Have a look at [4] for a nice article on threading in JavaScript.

[1] http://www.ecma-international.org/publications/files/ECMA-ST...

[2] http://www.whatwg.org/specs/web-workers/current-work/

[3] http://nodejs.org/

[4] http://odetocode.com/blogs/scott/archive/2007/01/08/javascri...

Re:Clojure's edge on Node.js by srveit on Thursday July 08, 2010 @11:29AM (#1497651)
It uses Google's open source V8 JavaScript engine. (http://code.google.com/p/v8/) It doesn't support multiple cores AFAIK. To use multiple cores, the server would need to spawn subprocesses or run multiple servers behind nginx.