Fabrice Bellard and Charlie Gordon are the project’s creators. You may recognize Bellard’s name or you may recognize some of his many contributions including the Tiny C Compiler, FFmpeg, and QEMU, and even a formula used to calculate the nth digit of π in base 16. His notable accomplishments don’t stop there. He also held the World Record for calculating pi to about 2700 billion decimal digits in 2009 on a single desktop computer.
What does this newest creation do?
From the engine’s page, the main features include:
- Small and easily embeddable: just a few C files, no external dependency, 190 KiB of x86 code for a simple hello world program.
- Fast interpreter with very low startup time: runs the 56000 tests of the ECMAScript Test Suite in about 100 seconds on a single core of a desktop PC. The complete life cycle of a runtime instance completes in less than 300 microseconds.
- Almost complete ES2019 support including modules, asynchronous generators and full Annex B support (legacy web compatibility).
- Passes 100% of the ECMAScript Test Suite.
- Garbage collection using reference counting (to reduce memory usage and have deterministic behavior) with cycle removal.
- Mathematical extensions: BigInt, BigFloat, operator overloading, bigint mode, math mode.
- Small built-in standard library with C library wrappers.
Test it out
An interactive demonstration of the engine and its capabilities is available to test out with a scientific calculator on NumCal.com. According to Bellard’s site, this demonstration is compiled from C to WASM/asm.js with Emscripten.
View the results from benchmark tests against other embeddable JS engines and test details.
The benchmarks prove it is lightweight. It tests better than DukTape, XS, MuJS, and the tiny IoT JS engine JerryScript. Users can download the bench-v8 source code themselves in the test archives and test other engines (provided that they can run the benchmark).
This project is open-sourced under the MIT license.