In January, we open-sourced ChakraCore, the core of the Chakra JavaScript engine that powers Microsoft Edge and Universal Windows Platform. We expressed our ambition to bring our best-in-class, but Windows-only, JavaScript engine to other platforms, with Linux as the prioritized target. Today at NodeSummit, we are delighted to share our progress – the first experimental implementation of ChakraCore interpreter and runtime on x64 Linux and OS X 10.9+, along with experimental Node.js with ChakraCore (Node-ChakraCore) on x64 Linux. Our development and testing on Linux happens primarily on Ubuntu 16.04 LTS, but the support should easily translate to other modern Linux distributions.

ChakraCore on Linux and OS X

ChakraCore and by extension Node-ChakraCore, on other platforms have the same support for the broad set of JavaScript features as their Windows counterparts, as measured by the official ECMAScript conformance suite, test262 (with the exception of Intl features, which are in progress). The current cross-plat implementation doesn’t yet support JIT compilation and concurrent and partial GC features, which we will enable as development progresses further.

Building cross-platform applications with ChakraCore

Bringing ChakraCore to Linux and OS X is all about giving developers the ability to build cross-platform applications with the engine. The JavaScript Runtime (JSRT) APIs to host ChakraCore were originally designed for Windows, so they inevitably had a few Windows dependencies – for example, Win32 usage of UTF16-LE encoding for strings, where other platforms might use UTF8-encoded strings. As part of enabling cross-platform support, some of the JSRT APIs have been refactored and redesigned to allow developers to write platform agnostic code to embed ChakraCore. Maintaining backwards compatibility is a core principle that we follow – so applications written with the previous set of JSRT APIs on Windows will continue to work as is. You can build the engine and write a Hello-world app to get started with ChakraCore on the Windows/Linux/OS X.

Node-ChakraCore on Linux

It has been a little over a year since we started working on Node-ChakraCore, with the intention to grow the reach of Node.js ecosystem. One of the fundamental goals of this project from the beginning has been to ensure that the existing ecosystem continues to just work, in an open and cross-platform way exactly like Node.js.

Earlier this year, shortly after open sourcing ChakraCore, we submitted a pull request to Node.js mainline to enable Node.js to work with ChakraCore. Today, we are taking another major step in the Node-ChakraCore journey. As part of enabling Linux support for ChakraCore, we are also sharing the first preview for Node-ChakraCore on Linux at our repo. This is a very early step in our full support for Linux, but we are excited to share the progress.

Running http-server sample on Node-ChakraCore

Coming up next

This is just the beginning of our cross-platform efforts, and we will keep enhancing our cross-platform support. We will continue to update the ChakraCore roadmap as we make progress. We’re currently working on Intl support, so that ChakraCore has feature parity across platforms. Also high on our list of priorities is to ensure non-Windows ChakraCore users experience the same top-tier JavaScript performance available on Windows today. To enable that, we’ll bring the fully-capable ChakraCore JIT compiler and concurrent and partial GC on Windows to other platforms. These features will bring improved performance to Node.js and other applications hosting ChakraCore as well.

To the community

Our cross-platform journey has been made possible by great support from the community. We are grateful for the advice and feedback we received on ChakraCore issues and Gitter discussions, as well as plenty of high-quality pull requests that we have accepted to date. We look forward to seeing more developers contributing to the projects, and encourage developers to try out our experimental Linux and OS X support, and even build upon what we have and submit PRs to port it to platforms of their choice. As always, we are eager to hear your feedback – you can always reach us by opening issues on ChakraCore or Node-ChakraCore repo or send us a tweet @ChakraCore.

Limin Zhu, Program Manager, Chakra
Arunesh Chandra, Sr. Program Manager, Chakra

Source: Bringing ChakraCore to Linux and OS X | Microsoft Edge Dev Blog