QEMU and FFmpeg Founder Publishes QuickJS JavaScript Engine

French mathematician Fabrice Bellard, who once founded the QEMU and FFmpeg projects, and also created the fastest formula for calculating pi and developed the image format BPG, published the first release of a new JavaScript engine QuickJS. The engine is compact and focused on embedding in other systems. The project code is written in C and distributed under the MIT license. Also available is an assembly of the engine compiled to WebAssembly using Emscripten and suitable for execution in browsers.

JavaScript Implementation supports the the ES2019 specification, including modules, asynchronous generators, and proxies. Non-standard maths are optionally supported. expansion for JavaScript, such as the BigInt and BigFloat types, as well as operator overloading. In terms of performance, QuickJS is significant surpasses existing analogues, for example, in the test
bench-v8 is ahead of the engine XS by 35%, duktape more than twice jerryscript three times and MuJS seven times.

In addition to the library for embedding the engine in applications, the project also offers the qjs interpreter, which can be used to run JavaScript code from the command line. Moreover, the qjsc compiler is available, capable of generating standalone executable files that do not require external dependencies.

Main Features:

  • Compact and easy to integrate into other projects. The code includes only a few C files that do not require external dependencies to build. The compiled simple application takes about 190 KB;
  • Very high performance and low startup time. Passing 56 thousand ECMAScript compatibility tests takes about 100 seconds when executed on a single core of a typical desktop PC. Runtime initialization takes less than 300 microseconds;
  • Nearly full support for the ES2019 specification and full support for Annex B, which defines components for compatibility with older web applications;
  • Complete passing of all tests from the ECMAScript Test Suite;
  • Support for compiling Javascript code into executable files without external dependencies;
  • Reference-counted garbage collector without cleanup cycling, which allowed for predictable behavior and reduced memory consumption;
  • A set of extensions for mathematical calculations in the JavaScript language;
  • A shell for executing code in command line mode that supports contextual code highlighting;
  • A compact standard library with bindings over the C library.

The project also develops three companion C-libraries involved in QuickJS and suitable for a separate application:

  • libregexp is a fast implementation of regular expressions that is fully compliant with the Javascript ES 2019 specification;
  • libunicode - a compact library for working with Unicode;
  • libbf is an implementation of arbitrary precision floating point operations and exact rounding transcendental functions.

Source: opennet.ru

Add a comment