Live data from Hacker News

Enable Node.js to Run with Microsoft's ChakraCore Engine

github.com

51–60 of 130 posts

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#51

It's important to remember that ChakraCore only currently builds on Windows, so this is only for Windows Node.js builds. The ChakraCore roadmap [1] shows that they plan on porting the interpreter to Ubuntu, but not to Mac OS, and they don't plan on porting the JIT. So even it does go Windows + Linux, it will still be a low-performing toy on Linux. This is vaguely interesting from a technical point of view, but doesn'…

The goal is for all of ChakraCore to be broadly cross-platform eventually, including the JIT, and including many more platforms than just Ubuntu x64. The roadmap reflects our next steps for the next 6 months but is not the entire journey. Disclosure: I work on Chakra

>> An implementation of ChakraCore interpreter and runtime, no JIT, on Linux.

You should update the wiki if you work on the project then. The stated roadmap goal seems fairly clear and aligns with a typical Microsoft strategy to ensure Windows remains the premium platform for its "open source" efforts.

Not being negative that is just the way it has gone in the past so you are fighting an uphill battle.

Disclosure: None

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#52
post #15

Earlier quoted context omitted.

Competition in the space leads to better engines. I put a link in another comment to last week's discussion on the topic. But my main concern is developers writing code that tries to bend around then V8 implementation, even if it's not required by the language. One great example from that thread was about try/catch: "For example, a try/catch in V8 triggers deoptimization for the entire function it's in, while it migh…

And that was just the first thing off the top of my head, there are tons of other little performance things that many people consider a "JavaScript thing" instead of a "V8 thing"

Does it matter? If V8 deoptimizes code with try/catch, then I as a developer need to account for that.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#53
post #21

Interesting development, a good one at that! A few questions though. Node tracks V8 releases, so the first thing I'm wondering is whether ChakraCore will continue emulating V8 APIs into the future? What happens when ChakraCore adds breaking changes which V8 doesn't support? I presume MS will be supporting most development on the engine, as they benefit from IoT Core and other applications relying on Node. If Mozilla…

> If I were to predict, I'd see Node switching to ChakraCore as its primary engine in a year. Chakra doesn't even compile on Mac OS or Linux, where the majority[1] of instances run. If I didn't know better, I'd say Microsoft isn't interested in Chakra-Node running on other platforms - only on Windows, but with a V8-beating performance or other 'desirable' Chakra-only extensions (extend). Want high performance NodeJS?…

The roadmap for ChakraCore includes getting it to run cross-platform. Additionally, as ChakraCore is Free Software, you're more than welcome to fork it and/or submit patches as needed.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#54
post #22
post #19

This is awesome, but before anyone uses this for something real keep in mind that the way this works is that Microsoft has created a shim on top of Chakra that exposes a V8 API. If V8 changes its API drastically (which it frequently does) this little experiment is basically over. There is only so much work people can do to keep up with a moving target. Barring NodeJS creating an abstract JS engine API that developers…

Well said! One of the issues that spawned io.js was the lack of keeping up with V8 changes. I was asking the same question of what happens when V8 does something MS don't follow? It'll be interesting to see in the future. Good thing this happened when Node has an open governance model, so we can follow developments in future.

I think the long-term solution is to drop V8. The V8 developers pretty much do not care about Node at all. Perhaps Chakra can come to some agreement to keep their APIs stable and if so they can become the new default engine.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#55
post #52

Earlier quoted context omitted.

And that was just the first thing off the top of my head, there are tons of other little performance things that many people consider a "JavaScript thing" instead of a "V8 thing"

Does it matter? If V8 deoptimizes code with try/catch, then I as a developer need to account for that.

Why? Most users aren’t on V8.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#56
post #55
post #52

Earlier quoted context omitted.

Does it matter? If V8 deoptimizes code with try/catch, then I as a developer need to account for that.

Why? Most users aren’t on V8.

Because a lot of them do, and nearly 100% of servers do.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#57
post #52

Earlier quoted context omitted.

And that was just the first thing off the top of my head, there are tons of other little performance things that many people consider a "JavaScript thing" instead of a "V8 thing"

Does it matter? If V8 deoptimizes code with try/catch, then I as a developer need to account for that.

It does!

V8 has expressed interest in fixing the try/catch deopt, but it keeps falling behind on their list because not many people are using it.

Most people aren't using it because V8 (and in some minds, mine included until 5 days ago, all of Javascript) doesn't optimize it.

It's a bit of a catch 22, and having alternate engines where that deopt doesn't happen can be the way out.

Basically having an alternate engine makes sure that stuff like this doesn't become permanent. You'll probably avoid try/catch in performance code for the near future (and i'll most likely do it as well), but the hope is that multiple implementations will force V8 to fix that issue (if it can be called that) at some point and eventually this little bit of optimization will no longer be necessary.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#58
post #52

Earlier quoted context omitted.

And that was just the first thing off the top of my head, there are tons of other little performance things that many people consider a "JavaScript thing" instead of a "V8 thing"

Does it matter? If V8 deoptimizes code with try/catch, then I as a developer need to account for that.

then I as a developer need to account for that

Why? Switch out V8 for ChakraCore. Having multiple engines means you, as a developer, get to pick the right tool for the job. That's not always V8.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#59
But it currently doesn't actually support any other platform or have a design that would easily allow that. You are at the front lines of embrace, extend, extinguish. Get away from the Dark Side and the Empire and join the rebels, before you are forced to do something terrible.

Re: Enable Node.js to Run with Microsoft's ChakraCore Engine

#60
post #52

Earlier quoted context omitted.

Does it matter? If V8 deoptimizes code with try/catch, then I as a developer need to account for that.

It does! V8 has expressed interest in fixing the try/catch deopt, but it keeps falling behind on their list because not many people are using it. Most people aren't using it because V8 (and in some minds, mine included until 5 days ago, all of Javascript) doesn't optimize it. It's a bit of a catch 22, and having alternate engines where that deopt doesn't happen can be the way out. Basically having an alternate engine…

I don't think V8 deoptimises on a try-catch - I think it doesn't optimise in the first place. It's a bailout rather than an uncommon trap I believe.
Post reply on HN