📜 ⬆️ ⬇️

Microsoft Edge JavaScript engine source code will open in January

At the end of last week at the JSConf US Last Call conference (Florida, USA) we announced that we would open the source code of the key components of our JavaScript engine, Chakra, used in Microsoft Edge, in the form of the ChakraCore project. The source code will be available on GitHub under the MIT license next month.


Gaurav Seth on stage JSConf US Last Call announces ChakraCore. Slides are available on github.

Chakra is one of the best JavaScript engines with the largest coverage of ES2015 features and predictable performance, reliability and scalability. We assume that ChakraCore can be used in scenarios where these factors play a large role: from cloud services to the Internet of things and in other environments.
')
Today we are investing in improving Chakra more than ever, and we are excited about the opportunity to develop cooperation with the community to implement further improvements. Several organizations have already talked about their interest in contributing to Chakra, including Intel, AMD and NodeSource - we are optimistic about our future collaboration.

Chakra: a modern JavaScript engine




In 2008, we created a new JavaScript engine from scratch called the code name Chakra. One of the fundamental principles of development was to be sure that Chakra will provide the level of performance required for the modern web, and will be able to easily adapt to new scenarios in a wide range of used hardware. Simply put, this meant that Chakra had to quickly start, work quickly, maintain an excellent user experience, while realizing the full potential of the iron used. We achieve these goals through a unique multi-stage execution chain, including an interpreter, a multi-level background JIT compiler, and a garbage collector that can perform parallel and partial memory cleanups.


Multistep code execution in Chakra and ChakraCore

Since the advent of Chakra, JavaScript has grown from a language that works predominantly inside a web browser to a technology that allows you to create applications for stores , server applications, cloud services, NoSQL databases, game engines, development tools and, a new trend, Internet of Things . Over time, Chakra has evolved to display many of these new contexts and has been optimized accordingly. This means that in addition to executing the code, Chakra had to support native portability, be scalable, and be able to manage the resource consumption for executing code in limited conditions . The Chakra interpreter has played a key role in the ease of technology transfer between different platform architectures.

Today, in addition to the Microsoft Edge browser, the Chakra engine also works in universal Windows applications in all form factors that Windows supports — be it an Xbox, a smartphone, or a traditional PC. It is at the core of services such as Azure DocumentDB , Cortana, and Outlook.com , used in conjunction with (and optimized for) TypeScript . And within Windows 10, we also made it possible to launch Node.js on top of Chakra , in order to bring the broad possibilities of the Node.js ecosystem to the new IoT platform: Windows 10 IoT Core .

With the release of Windows 10 this summer, Chakra has not only become even faster for the web , but has more than doubled its results in some key tests for measuring the speed of JavaScript engines developed by other browser manufacturers.


Chakra performance in JavaScript speed tests - Octane and Jetstream (System information: 64-bit browsers on Intel Core i5-34755 @ 2.90Ghz with 4.0GB RAM under Windows 10)

In addition, Chakra supports most of the features of ECMAScript 2015 (aka ES6) and some features from a future version of ECMAScript, such as Async Functions and SIMD . We have added support for asm.js and are also involved in the development of WebAssembly and related infrastructure .


Chakra supports most of the features of ES6 ( Kangax ES6 Compatibility Table )

Thus, since 2008, Chakra has gradually evolved to become an excellent choice for the web, cloud services and the Internet of things. With today's announcement, we take the next step by offering developers a fully supported open-source JavaScript engine that you can embed in your projects, do something on top of it, and suggest your changes back to ChakraCore.

What is ChakraCore?


ChakraCore is a complete and self-contained JavaScript virtual machine that can be embedded in derived projects and support applications that require the use of scripts, for example, NoSQL database, productivity applications and game engines. ChakraCore can be used to extend the capabilities of JavaScript on the server in conjunction with Node.js and cloud services. It includes everything you need to parse, interpret, compile, and execute JavaScript code without any dependencies on other components of Microsoft Edge.

ChakraCore includes the same feature set as Chakra in Microsoft Edge with two key differences. First, it does not expose private APIs to bind to the browser or the universal Windows platform (UWP), which is a very specific scenario. And second, instead of providing the COM-based diagnostic API currently used in Chakra, ChakraCore will support a new set of platform-independent diagnostic APIs that, in principle, can be standardized or made compatible between different implementations in the long run. As we implement this new API set, we also plan to add them to Chakra.


Chakra and ChakraCore device

Next steps in the development of ChakraCore


Any modern JavaScript engine should be considered in a wider context than just browser scenarios, including everything from small devices for IoT applications to huge solutions with parallelized cloud-based server applications.

ChakraCore was designed to fit any application stack that requires a fast, scalable, and lightweight engine. Over time, we plan to make it even more flexible: both within the Windows ecosystem and beyond. Although the initial January release will only target Windows, we can confirm the intention to move ChakraCore to other platforms in the future. We invite developers to help us realize this aspiration: you can just let us know on which platform you would like to see support from ChakraCore, so that we can prioritize our resources and investments, or even help with porting to the platform you are interested in.

How to contribute to ChakraCore


Starting in January, we will open our public repository on GitHub for the community. By this time, we will share additional details about our initial development priorities and guidelines for working with the project and making changes. The community is the heart of any open source project, so we will be happy to see repository clones, code research, new builds, and your input on everything from new functionality to tests and bug fixes. We will also welcome advice on how to improve ChakraCore in specific scenarios that are critical to your business.

We want to make Microsoft Edge and its associated ecosystem an example of collaborative innovation, interoperability and productivity growth in development. This intention has already led to the creation of a new Microsoft Edge Dev site, a public publication of platform status and the use of User Voice to simplify the dialogue between the Microsoft Edge team and the community. The opening of the ChakraCore code is a natural continuation of these efforts and is inspired by those principles of openness and transparency.

This reference point will come soon and we hope that an open development process will allow us to work more closely with developers around the world, which in turn will allow us to create even better products for everyone. Any questions about Edge you can always ask on our twitter @MSEdgeDev . Wait for announcements after the New Year holidays!

- Gaurav Seth, Principal PM Manager
- Adalberto Foresti, Principal Program Manager

Bonus


Christian Heilmann recorded an interview with Gaurav Seth on the development of JavaScript, Chakra and ChakraCore:

Source: https://habr.com/ru/post/272809/


All Articles