Hacker News new | ask | show | jobs
by morebetterer 3805 days ago
Many posters in that Github Chakra pull request thread appear to be in the "Node is V8 and only V8" camp. This is disappointing. Since when is having a bigger developer community, supporting the latest ES6 standards, and having wider reach for NodeJS a bad thing? Look at what the friendly rivalry has done for the various browsers - the competition benefitted everyone and advanced technology immeasurably.
2 comments

I'm a node.js developer and I don't really care what interpreter is being used as long as any code submitted to NPM is compatible with any version of node.js regardless of the JavaScript engine.

The only issues would be in ChakraCore were to support additional ES6/7 features that people started to use that wouldn't work on a V8 node.js instance, or the other way around.

How is that different from how node v5 supports additional ES6/7 features that don't work in node v4? In the end you can only rely on package authors to be aware of their targets' capabilities and code to the minimum baseline accordingly.
npm needs to learn how to deal with that. For example, if a package is marked as requiring 5.4, but you have 4.2, then it should automatically use a tool like babel to convert unavailable ES6 syntax to ES5 for compatibility. I really want to be able to write my modules to take advantage of ES6 while not having to build all that babel stuff into my module for compatibility.
Some of that is possible, but some of that is not. Consider the use case of WeakMaps or Proxies that cannot truly be polyfilled, they need to be implemented at the language level.

Suppose you could transpile what is possible, then throw errors otherwise, however that would involve parsing each file in an NPM module which is probably an unreasonable task performance wise.

For now, it's different because Node + Chakra doesn't run on all the supported platforms, but v8 does.

It's easy to install NodeJS 5 with v8, it is however unacceptable to be required to switch to Windows.

This could change if they get around to porting it completely. For now the only thing they've committed to in the next 6 months is porting the ChakraCore interpreter(but not the JIT).

Because if the argument is better support and wider reach then maybe wait until it runs on more than one platform.

Edit: even if they had waited until the JITless builds for OS X and Linux were ready I'd be happier. This definitely feels like jumping the gun.

As long as each JS engine uses the same API (at this point V8's C++ API, hopefully something engine neutral later) what difference does it make?
It shouldn't be merged into core if it doesn't work on the rest of the platforms core works on. Keep it in some experimental branch until it is ready and more important why would they even submit the PR if a ton of tests are failing?
If it's a compile-time switch to build v8 or Chakra and it's not impeding Node development, there's no harm.

Node is a large code base. The Chakra merge will eventually work and pass all tests - give it some time. One cannot reasonably expect such a large merge to work flawlessly out of the gate. Even the IBM PowerPC port of the V8 engine took many months to stabilize - and it's the same v8 engine.