BT

Microsoft Open Sources Chakra and Wants to Run Node.js on It

by Abel Avram on Jan 14, 2016 |

True to their promise to open up the Edge’s JavaScript VM, Microsoft has made available the source code of Chakra under the permissive MIT license. Released under the name ChakraCore, the code is basically the same VM Microsoft uses for Edge and the Universal Windows Platform (UWP) minus the bindings to Edge and UWP and some COM diagnostic APIs.

ChakraCore comes as an embeddable engine that can be incorporated into various desktop, server and IoT applications, and this is what Microsoft hopes that developers will find it useful for. The engine is wrapped by the JavaScript Runtime (JSRT) APIs which provide access to the runtime and one or multiple execution contexts. ChakraCore does its own garbage collection and exception management. ECMA2015 language features that are supported work as they are, but Promises need to be queued up in EnqueueJob to work with ChakraEdge.

Microsoft is also working on making Node.js run with the ChakraCore engine besides the usual V8 one. They have achieved this by creating a V8 shim on top of JSRT, enabling Node.js applications run as usual without knowledge of the JavaScript VM underneath. The project can be found at Microsoft/node on GitHub.

Microsoft intends to add modern diagnostic APIs to ChakraCore, and they are working on Time Travel Debugger, a debugging tool that enables one to step backwards during debugging. This helps with debugging code that contains callbacks. Microsoft has demonstrated the debugger on a Node.js/ChakraCore application that included over 100 modules, running on a Raspberry Pi 2 with Windows 10 IoT. They intend to mature the technology and then open it up.

For the near future, Microsoft intends to port ChakraCore to other platforms, starting with Linux Ubuntu 15.10 x64. They also plan to bring forward some of the JavaScript features that now are supported via an experimental flag – Destructuring Assignment, Default Parameters, Exponentiation Operator, Async. ES2015 Modules are to be supported via an experimental flag and they intend to run WebAssembly code through the asm.js pipeline.

Will developers adopt ChakraCore? Microsoft believes they will, showing as incentive the performance benchmark results where Edge beats both the latest Chrome and Firefox on Octane 2.0 and Jet Stream tests. ChakraCore also supports 79% of the ES6 features compared to 85% for Firefox 45 and 71% for Chrome 49, according to Kangax’s JavaScript compatibility table. Whatever the adoption outcome will be, Microsoft intends to develop ChakraCore publicly, including the results back into Edge and the UWP.

Rate this Article

Relevance
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

I like it by Nick Kasvosve

Excellent move

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss
General Feedback
Bugs
Advertising
Editorial
Marketing
InfoQ.com and all content copyright © 2006-2016 C4Media Inc. InfoQ.com hosted at Contegix, the best ISP we've ever worked with.
Privacy policy
BT