Microsoft announced it is open-sourcing Chakra, the JavaScript engine that powers its Edge Web browser.
The company made the announcement today at the JSConf US Last Call in Amelia Island, Fla. Microsoft said it will open-source the core components of Chakra as ChakraCore, which will include all the key components of the JavaScript engine powering Microsoft Edge. The company expects to open the ChakraCore repository on GitHub next month, according to a blog post written by Adalberto Foresti and Gaurav Seth, both managers on the Microsoft Edge browser team.
“Chakra offers best-in-class JavaScript execution with the broadest set of ES2015 feature coverage and dependable performance, reliability, and scalability,” the post said. “We expect ChakraCore to be used wherever these factors are important, ranging from cloud-based services to the Internet of Things and beyond.”
Microsoft describes ChakraCore as a fully fledged, self-contained JavaScript virtual machine that can be embedded in derivative products and power applications that need “scriptability” such as NoSQL databases, productivity software, and game engines. ChakraCore can be used to extend the reach of JavaScript on the server with platforms such as Node.js and cloud-based services. It includes everything that is needed to parse, interpret, compile and execute JavaScript code without any dependencies on Microsoft Edge internals, the Microsoft post said.
Moreover, the post explains that ChakraCore shares the same set of capabilities that are supported by Chakra in Microsoft Edge, with two key differences. First, it does not expose Chakra’s private bindings to the browser or the Universal Windows Platform, both of which constrain it to a very specific use case. Second, instead of exposing the COM based diagnostic APIs that are currently available in Chakra, ChakraCore will support a new set of modern diagnostic APIs, which will be platform agnostic and could be standardized or made interoperable across different implementations in the long run. And, as the company progresses on these new diagnostics APIs, Microsoft will make them available in Chakra as well.
Microsoft is intent on working with the community to improve Chakra. “In addition to the public, several organizations have already expressed interest in contributing to ChakraCore—among many others, we look forward to working with Intel, AMD, and NodeSource as we develop this community,” the post said.
In 2008, Microsoft decided to invest in JavaScript by creating a new JavaScript engine, codenamed Chakra, from a clean slate. “Our founding principles were to ensure that Chakra had the performance characteristics needed for the modern web and could easily adapt to other potentially emerging scenarios, across a range of hardware profiles,” Microsoft said. “In a nutshell, this means that Chakra needed to start fast, run fast, and deliver a great user experience, while utilizing the full potential of the underlying hardware. Chakra achieved these goals via a unique multi-tiered pipeline that supports an interpreter, a multi-tiered background JIT compiler, and a traditional mark and sweep garbage collector that can do concurrent and partial collections.”
Microsoft Open-Sources ‘Chakra’ JavaScript Engine
Microsoft integrated blog post describing the integration, Dean Hachamovitch, formerly general manager for the Internet Explorer browser wrote: “We’re committed to the right foundation for HTML5 applications, including performance and ensuring the same markup and same script work across browsers. One aspect of doing these things well is integrating the JavaScript engine natively inside the browser, rather than bolting it onto the side to support multiple JavaScript engines as some other browsers do today. How a JavaScript engine is integrated into the browser is as important as the engine itself for real-world HTML5. The fourth Platform Preview moves the new JavaScript engine, codenamed Chakra, inside IE9 and brings them together into one single, integrated system.”
However, since Chakra’s inception, JavaScript has expanded from a language that primarily powered the Web browser experience to a technology that supports apps in stores, server side applications, cloud-based services, NoSQL databases, game engines, front-end tools and most recently, the Internet of Things, Foresti and Seth said. Over time, Chakra evolved to fit many of these contexts and has been optimized to deliver great experiences across them all, they said.
“This meant that apart from throughput, Chakra had to support native interoperability, great scalability and the ability to throttle resource consumption to execute code within constrained resource environments. Chakra’s interpreter played a key role in easy portability of the technology across platform architectures,” the post said.
In addition to the Microsoft Edge browser, Chakra powers Universal Windows applications across all form factors supporting Windows 10, including an Xbox, a phone, or a traditional PC. It powers services such Azure DocumentDB, Cortana and Outlook.com. It is used by TypeScript. And with Windows 10, Microsoft enabled Node.js to run with Chakra, to help advance the reach of Node.js ecosystem and make Node.js available on a new IoT platform: Windows 10 IoT Core, Foresti and Seth said.
Moreover, they noted that with the release of Windows 10 earlier this year, Chakra was not only optimized to run the Web faster, but more than doubled its performance on some key JavaScript benchmarks owned by other browser vendors. Chakra supports most of the ECMAScript 2015 (aka ES6) features and has support for some of the future ECMAScript proposals like Async Functions and SIMD. It supports asm.js and the team is helping to evolve WebAssembly and its associated infrastructure, Microsoft said.
“Any modern JavaScript Engine must deliver on a performance envelope that goes beyond browser scenarios, encompassing everything from small-footprint devices for IoT applications, all the way up to high-throughput, massively parallel server applications based on cloud technologies,” the post said. “ChakraCore is already designed to fit into any application stack that calls for a fast, scalable, and lightweight engine. We intend to make it even more versatile over time, both within and beyond the Windows ecosystem. While the initial January release will be Windows-only, we are committed to bringing ChakraCore to other platforms in the future…”