December 5, 2015 6:37 am

Microsoft Edge’s JavaScript engine to go open-source

Updated on 1/13/16: The ChakraCore GitHub repository is now open

Today at JSConf US Last Call in Florida, we announced that we 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 ChakraCore sources will be made available on GitHub under the MIT license next month.

Photo of Gaurav Seth on stage at JSConf US Last Call announcing ChakraCore

Gaurav Seth on stage at JSConf US Last Call announcing ChakraCore. View the slides on GitHub.

Chakra offers best-in-class JavaScript execution with the broadest set of ES2015 feature coverage and dependable performance, reliability, and scalability. We expect ChakraCore to be used wherever these factors are important, ranging from cloud-based services to the Internet of Things and beyond.

We’re investing more than ever in improving Chakra, and are excited to team up with our community to drive further improvements. 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.

Chakra: A modern JavaScript engine

In 2008, we created 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. 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.

Diagram showing the Chakra execution pipeline.

Chakra & ChakraCore’s multi-tiered execution pipeline

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. Over time, Chakra evolved to fit many of these contexts and has been optimized to deliver great experiences across them all. 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.

Today, outside of the Microsoft Edge browser, Chakra powers Universal Windows applications across all form factors where Windows 10 is supported—whether it’s on an Xbox, a phone, or a traditional PC. It powers services such Azure DocumentDB, Cortana and Outlook.com. It is used by (and optimized for) TypeScript. And with Windows 10, we 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.

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.

Graph showing performance of Chakra in Microsoft Edge relative to competing browsers on Octane and Jet Stream.

Chakra’s performance on key JavaScript benchmarks – Octane and JetStream
(System info: 64-bit browsers on Intel Core i5-34755 @ 2.90Ghz with 4.0GB RAM running Windows 10)

Additionally, 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 a key participant in helping evolve WebAssembly and its associated infrastructure.

Chart showing ES6 feature support across browsers.

Chakra has the most support for ES6 features of any shipping browser (Kangax ES6 Compatibility Table)

Since its introduction in 2008, Chakra has grown to be a perfect choice for the web, cloud services, and the Internet of Things. With today’s announcement, we’re taking the next step by giving developers a fully supported and fully open-source JavaScript engine available to embed in their projects, innovate on top of, and contribute back to: ChakraCore.

What’s in ChakraCore?

ChakraCore is 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.

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. As we make progress on these new diagnostics APIs, we plan to make them available in Chakra as well.

Diagram showing the componentization of Chakra and ChakraCore. ChakraCore contains all the core components of Chakra with the exception of COM diagnostic APIs and the private bindings to the Microsoft Edge browser and Universal Windows Platform.

Componentization of Chakra and ChakraCore

What’s next for ChakraCore?

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.

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. We’d invite developers to help us in this pursuit by letting us know which other platforms they’d like to see ChakraCore supported on to help us prioritize future investments, or even by helping port it to the platform of their choice.

Contributing to ChakraCore

Starting in January, we will open our public GitHub repository for community contributions. At that time, we will provide more detail on our initial priorities and guidance on how to contribute effectively to the project. The community is at the heart of any open source project, so we look forward to the community cloning the repository, inspecting the code, building it, and contributing everything from new functionality to tests or bug fixes. We also welcome suggestions on how to improve ChakraCore for particular scenarios that are important to you or your business.

We are committed to making Microsoft Edge and its associated ecosystem a benchmark for collaborative innovation, interoperability, and developer productivity. This commitment led to initiatives like the new Microsoft Edge Dev site, Platform Status, and User Voice to foster a two-way dialog between the Microsoft Edge team and the community. Open-sourcing ChakraCore is a natural complement to that effort, and is inspired by the same principles of openness and transparency.

We’re excited about this milestone, and are hopeful that developing in the open will allow us to collaborate even more deeply with more developers around the world, resulting in better products for everyone. If you have any questions or if there is something we didn’t cover, let us know @MSEdgeDev on Twitter or in the comments section below! We look forward to sharing more soon.

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

Updated January 13, 2016 12:34 pm

Join the conversation

  1. Since MSFT is partnering up with Google now for its development strategy (which does ultimately harm .NET now, but I digress), maybe this partnership can be leveraged to move Chakra into Chrome? How awesome would it be to see Chakra picked up by Google, Apple, FireFox (and others) as well, becoming the de facto JavaScript engine across the board? Hopefully since this is open source now, this would be possible? It certainly would help the cause.

    That would make it easier to make it the executing engine of choice in implementing in this idea: http://visualstudio.uservoice.com/forums/121579-visual-studio-2015/suggestions/10027638-create-a-ubiquitous-net-client-application-develo

    Thank you for any consideration/support and/or dialogue around this idea. 🙂 This is exciting news!

    • No, you should not hope for this. Ever. A single JavaScript engine is not a good thing, it hampers innovation and leads to stagnation (like in the 2001 – 2008 90% market share Internet Explorer era) and reliance of bugs of a single engine to dictate the future of JavaScript. Competition leads to innovation and progress.

      • Good points. Your concerns are valid… that is, if it actually stagnates. In this case it features open source and open community involvement, something that IE back in 2001-2008 did not feature. Again if there are bugs, the community has the power to fix them and improve/evolve the product. Additionally, would you want 1 engine out there with its own set of bugs or 3-4 with their own set of prohibitive bugs (as we have now).

        Finally, it looks like I am not the only one thinking along this line:
        https://twitter.com/dstorey/status/673219493724733440

        ALL THE CHAKRA! 🙂

      • This is not a valid point. It is open source so that means that the code can be modified by the community or users extensively (much like Android). This does not shut down innovation, it prevents re-inventing the wheel.

        • Agreed. This being open-source means everyone can contribute to it. The single biggest hurdle in web development right now is the different implementations from different vendors. I’d argue that if one open-source (the key thing here is open-source) engine dominates the market, it’d actually be more beneficial in the long run.

          If everyone is forced to use that single engine, and the engine itself is standard-compliant, then even enterprises would, sooner or later, be conforming to the same standard everyone else uses, instead of using the out-of-date IE6/7/8.

  2. Wow, congratulations for doing the right thing! This is very exciting.

    Just to clarify – what model will it be?
    – The Android model where the development is done behind closed doors and dumped into the open source repository after a version is in public beta.
    – The V8 model where almost all of the development is done within the open source repository, except internal prototyping and the occasional competitive feature sometimes (like the V8 Crankshaft optimization engine at the time). Features as well as bugs are tracked in the issue tracker.

    I am guessing mostly the V8 model, but I want to verify.

    Also, I guess this is a silly question, but will Microsoft Edge (and the rest of the gang) use the open sourced ChakraCore (with the addition of the closed source private binding you mentioned, of course), or is the code mostly for display and accepted pull requests will not necessarily be committed into your internal repository that is used by Microsoft Edge?

    • Really solid questions here. MSFT is really new to the open source game and I am sure there will be growing pains on some level as they figure things out.

    • @Numb Still: Yes. I’ll not compare, but we’ll develop in the open is the answer.

      The Chakra build shipping with Microsoft Edge will be refreshed regularly with community contributions. The exact pace at which that will happen will depend primarily on the release milestones for Windows and Microsoft Edge. Generally, changes that will make it to the ChakraCore GitHub master branch will have a short journey to Chakra and Microsoft Edge, shipping in Windows Insider Preview builds first and then stable releases.

    • Not Edge, but ChakraCore. And yes, ChakraCore would be supported downlevel till Windows7.

  3. As a system component, will there be a way to build and install this? If so, does this imply that Win10’s Chakara JSVM could, with significant work, be replaced with a different engine? Will the JS engine APIs being developed for Node be the same ones used by Win10?

    • The system component is Chakra, which has the bindings to the browser and the underlying UWP. ChakraCore is a standalone JSVM that developers can build and install. Several products outside of the Edge browser are already embedding Chakra using the JSRT APIs that are currently used for embedding Chakra in Node.

  4. The recent direction taken by the company in embracing and endorsing open-source in public is tremendous! Goes a long way to win back fan boys! Great work!!

  5. That’s great news. Any plans to open source the Edge browser itself? Browser is really lacking basic features and crashes quite often, community might help.

  6. Hey, I’m a bit new to the Web development community and I think I might have missed this, but what are the resources for edge development? Are we using a new set of standards related to html/css, Javascript, and jscript? Where can I find resources that will help me develop for Microsoft edge?

    I want to stay up to date as possible with this technology and would like as much assistance as possible. Thanks everyone.

    • @Robert DeSautel:
      To develop for Edge, just as with Chrome, Firefox, etc., all you really need is a computer, and a text editor. You can, if you wish choose to use an flexible editor like VIM, EMACS, etc. You may also prefer modern, extensible, editors such as SublimeText, Atom, etc. Alternatively, you may find IDE’s such as Visual Studio Code, Visual Studio 2015 Community Editon, JetBrains’ WebStorm, Eclipse, etc. helpful too.

      With regards your code: Aim to adhere to the HTML5, CSS3 & JavaScript 5/6 standards – that’ll give you your best chance of your site rendering and behaving the same way across most browsers/platforms.
      To learn: Read lots, watch video training/presentations (of which there are MANY), and practice. Lots. Expect to make mistakes. Expect to be exasperated. Expect to be frustrated, annoyed … and then, when it works … overjoyed! 🙂

      Most of all, have fun!

  7. I used the Noesis V8 port as a self-contained js engine for running scripts within a desktop or server .NET app. The Noesis port was not thread safe however and only one engine could run at a time within an app context.

    Will I be able to use a similar construct, instantiate the ChakraCore as an embedded service and load and run (and hook and sink events)? And do this with more than one engine at a time within one EXE?