5 ms·
> Finally, you can also use ChakraCore as the JavaScript engine in Node. This is interesting. You can use it as an alternative to v8 for node.js
by dmm 11y ago
> Finally, you can also use ChakraCore as the JavaScript engine in Node.
This is interesting. You can use it as an alternative to v8 for node.js
- brianwawok 11y agoWhat is the advantage of this? What does 1 more JS engine buy us?
- pookeh 11y agoBetter ES6 support.
- whatever_dude 11y agoYup https://kangax.github.io/compat-table/es6/ https://kangax.github.io/compat-table/es6/
- dsp1234 11y agoCompetition
- sylvinus 11y agoCompetition! Now both teams have one more incentive to innovate and we get better software in the end.
- saurik 11y agoAs far as I understand, v8 doesn't care about node, and would never think twice about doing something that breaks the entire node ecosystem if it makes Chrome slightly faster. FWIW, they aren't even "wrong": it makes sense to me. What is interesting here is not "competition" but "someone who builds a JavaScript engine wants you as a user".
- sylvinus 11y agoThat is probably true, but maybe this position stems more from the fact that they were never challenged than we think. I'm hoping some pride will be thrown into the mix and will make them care just a bit more than they currently do.
- murukesh_s 11y agoperhaps more competition? v8, though much faster than other engines when released, is still roughly twice as slow as go. while jvm (also uses JIT) is roughly twice as fast as go and reaching near native/c/c++ performance. I know it's not a fair comparison between javascript(dynamic) and java (typed), but I am sure there is still room for improvement.
- LamaOfRuin 11y agoIndependent implementations of standards.
- PeCaN 11y agoWell, Chakra is a bit ahead of V8 in ES6 implementation right now. https://kangax.github.io/compat-table/es6/ https://kangax.github.io/compat-table/es6/
- magicalist 11y agoActually, try it with current Chrome Canary (V8 version 4.9.355). They just hit 92% with no flags.
- zbraniecki 11y agoThat's awesome! With SpiderMonkey hitting 90%, WebKit at 81%, V8 92% and Chakra at 80%, ES6 as production target becomes realistic! I'm wondering when Android/iOS default browsers will get updates because that's going to be the one remaining blocker. (and IE11 of course... but that's just waiting for userbase to move away from it :/)
- realityking 11y agoApparently iOS 9.3 will include a bigger-than-usual Safari update. While there are no new big ES6 features mentioned in the announcement, I'm hoping for some smaller improvements.
- Klathmon 11y agoHaving more than one engine can mean that there is less of a V8 monoculture. Bugs in V8 don't become "standard" and "things that V8 is really good at" doesn't become "things that Javascript is really good at".
- Artemis2 11y agoThat's what Go does. The reference of the language is [an actual document](https://golang.org/ref/spec https://golang.org/ref/spec), not a reference implementation. There are two compilers (gc and gccgo), and this way, no edge-case of an implementation can make its way into programmers' habits, something that tends to happen a lot with JavaScript.
- jdmichal 11y agoMicrosoft was surprisingly open in this regard with C#. The C# language and the CLI bytecode are both ECMA standards (334 and 335) that could be implemented by anyone. Of course, this is with the realization that the .NET standard library gives Microsoft's C# implementation a lot of staying power.
- swang 11y agoWhat do you mean by the, "edge-case of an implementation... makes its way into programmers' habits" as something that happens a lot in javascript. Maybe I'm not understanding but I read that statement and I don't see how that applies to javascript.
- Klathmon 11y agoFor example, a try/catch in V8 triggers deoptimization for the entire function it's in, while it might not in other engines. So this leads to many developers avoiding try/catch in performance critical code. This ends up with them avoiding it in general usage, which means that now "avoiding try/catch" is considered a general purpose performance tip in javascript, even though it might only apply to one engine (and the v8 team has expressed interest in trying to stop that deopt) This might be a bad example, i'm honestly not sure how try/catch performs in other engines, i just know it deopts in V8. But the fact that i don't know if it's a javascript thing or a V8 thing speaks to my point.
- bsimpson 11y agoBefore Node was popular, I tried a command-line JS engine called Narwhal. It was built by 280 North, and as I recall, it had pluggable engines. I remember being surprised at how much faster JSCore (Safari's) felt than the others. Not being permanently coupled to a particular platform is probably a good thing for Node, and provides a healthy incentive for V8 to stay on-top of its game.
- ksp4186 11y agoMicrosoft is already working on lighting Node.js with ChakraCore. See https://github.com/Microsoft/node https://github.com/Microsoft/node
- morebetterer 11y agoIronically Microsoft had to create a V8 C++ API facade over Chakra in order for Node to compile with it. https://github.com/Microsoft/node/tree/chnext/deps/chakrashim https://github.com/Microsoft/node/tree/chnext/deps/chakrashi... It's interesting that the license of the Chakra shim is the V8 license: https://github.com/Microsoft/node/blob/chnext/deps/chakrashim/include/v8.h https://github.com/Microsoft/node/blob/chnext/deps/chakrashi...
- ksp4186 11y agoThat's correct. V8 license is required in v8-*.h files because they are v8 header files that chakra shim uses. The implementation files has Microsoft license. E.g. All files in https://github.com/Microsoft/node/tree/chnext/deps/chakrashim/src https://github.com/Microsoft/node/tree/chnext/deps/chakrashi... Disclaimer: I work for Chakra team (powering node.js)
- morebetterer 11y agoAny progress in talks with Node.JS to make an implementation independent JS engine API for node?
- ksp4186 11y agoIts a long goal as of now that everyone want to achieve. You can follow this discussion at https://github.com/nodejs/nan/issues/349 https://github.com/nodejs/nan/issues/349
- morebetterer 11y agoThat thread doesn't show a lot of promise towards an engine neutral API.
- tootie 11y agoOracle was working on getting node to run on the JVM, but it wasn't really open and it looks like it was abandoned: https://avatar-js.java.net/ https://avatar-js.java.net/
- chrisseaton 11y agoOracle's Graal.js will support Node.js https://www.youtube.com/watch?v=OUo3BFMwQFo&feature=youtu.be https://www.youtube.com/watch?v=OUo3BFMwQFo&feature=youtu.be
- hjek 11y agoRingoJS is pretty nice for JS server apps on the JVM though: http://ringojs.org/ http://ringojs.org/