Skip to main content

Boa release v0.16

· 4 min read

Summary

Boa v0.16 is now available! After around 3 months of development, we are very happy to present you the newest release of the Boa JavaScript engine. Boa makes it easy to embed a JS engine in your projects, and you can even use it from WebAssembly. See the about page for more info.

Boa currently supports part of the JavaScript language. In this release, our conformance has grown from 62.29% to 74.53% in the official ECMAScript Test Suite (Test262). The engine now passes 68,612 tests, coming from 56,372 in Boa 0.15 (21.7% increase), and we have closed 9 issues and merged 59 pull requests. You can check the full list of changes here, and the full information on conformance here.

New ECMAScript features

Support for Promises

With this new release Boa ships support for ECMAScript Promises. All tests in the 262 test suite built-ins/Promise pass. Promises enable asynchronous operations to be executed via an internal job queue. Starting with our work on Promises, we have stopped ignoring the 262 tests that are flagged as async. We also have enabled our 262 test runner to work with asynchronous tests. We would like to thank @aaronmunsters for proposing the initial PR for Promises (#1923) that we then could expand on.

// This program will print:
// 1. End of synchronous execution.
// 2. The Promise has been resolved.

let promise = Promise.resolve();

promise.then(() => console.log("2. The Promise has been resolved."));

console.log("1. End of synchronous execution.");

Support for Async/Await

The implementation of Promises has enabled us to implement async functions and the await keyword. The async/await syntax makes it easier to use Promises within javascript. We have implemented async functions, async generators, for await...of loops and the await keyword. While not all tests pass for these features yet, the basic functionality should work.

Dense/Packed JavaScript Arrays

JavaScript Arrays are regular objects whose values are stored as indexed properties. Because arrays have no fixed length, values can be assigned to any possible index without any of the previous indices being used. Due to this behavior indexed properties are stored in a map instead of in a vector, as the vector would allocate a lot of unused memory if a high index is used. We have implemented an optimization to make it possible to use optimized vector storage for array values, as long as indices are not assigned out of order. This has improved the performance of arrays around 45% for arrays without empty slots. To learn more about this optimization take a look at the PR #2167.

Support for URI encoding and decoding functions

This version for Boa ships with support for the built-in URI encoding and decoding functions encodeURI, decodeURI, encodeURIComponent and decodeURIComponent. With the exception of UTF-16 related test, all test in the relevant 262 test suites pass for these functions.

How can you contribute to Boa?

In March, Boa opened financial contributions on its OpenCollective page. If financial contribution is not your strength, you can contribute by asking to be assigned to one of our open issues, and asking for mentoring if you don't know your way around the engine. Our contribution guide should help you here. If you are more used to working with JavaScript or frontend web development, we also welcome help to improve our web presence, either in our website, or in our testing representation page or benchmarks page. You can also contribute to our Criterion benchmark comparison GitHub action.

We are also looking to improve the documentation of the engine, both for developers of the engine itself and for users of the engine. Feel free to contact us in Discord.

Thank You

Last but certainly not least, a big Thank You to all the contributors of this Boa release. We would like to particularly thank our new contributors: