3 ms·
node.js was built from scratch, in C, to resemble javascript syntax intentionally.
by cocktailpeanuts 10y ago
node.js was built from scratch, in C, to resemble javascript syntax intentionally.
- ryanolsonx 10y agoNo, it was not. It uses Chrome's JavaScript Engine, V8. From nodejs.org: > Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
- bobbytherobot 10y agoWhat? The engine is written in C, but all JavaScript engines are written in another language (C being the most popular) because it is an interpreted language. The engine isn't written from scratch because it is the V8 engine from Google. Of course the system binding and package system is written specifically for Node.
- paulddraper 10y agoC++, actually.
- jnbiche 10y agonode.js doesn't just resemble JavaScript, it is JavaScript. Like ES5 standard JavaScript, and (very soon) ES6 standard JS as well. It uses the V8 JS engine. The only non-standard features of Node.js has been the module system (CommonJS), but even that will be ECMA standard as of next version. (also, Node.js was built in C++ and JS)
- dcherman 10y agoThe module standard that is present in ES6 is a very different beast than CommonJS
- jnbiche 10y agoAgreed. I use ES6 modules regularly (via Babel compiled to CommonJS, and also Rollup). Unlike CommonJS, ES6 modules have the advantage (and disadvantage) of being statically resolved, which permits tree-shaking (but denies dynamic resolution of imports like CommonJS). The "that" in my sentence refers to "module system", not "CommonJS", but I agree my sentence was unclear.
- jnbiche 10y agoMore specifically: in the next major Node.js release (v7.0.0), ES6 modules will be implemented. That's what I was trying to say.