Hacker News new | ask | show | jobs
by Osiris 3805 days ago
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.

1 comments

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).