Online / 5 & 6 February 2022

visit

Building a tiny JavaScript runtime with QuickJS

How I built a runtime with Duktape and then rebuilt it with QuickJS


QuickJS is a (small) JavaScript engine by Fabrice Bellard.

Over the past 6 years I've built a couple of small JS runtimes, first using Duktape, then using QuickJS. The premise was to always use existing libraries to add functionality, including WASM support.

This presentation will go through the differences of both libraries and the 2 projects I built leveraging them.

There are many libraries out there which one can use to build a JS runtime these days, with the most well known one being V8.

Node and Deno are both using V8, but how would a different take at building a JS runtime look like?

I asked myself this question some years ago and started building a small project with Duktape. That project was ultimately a failure, but I learned very valuable lessons in runtime design and always wanted to revisit that project.

Fast forward a few years, QuickJS was released by Fabrice Bellard, and I was excited! It was so easy to integrate that I began to implement a new runtime using it. This runtime is called txiki.js and while it's a small project it already integrates libuv for fast networking and the event loop, curl for making HTTP requests and wasm3 for WASM (and WASI!) support.

Speakers

Photo of Saúl Ibarra Corretgé Saúl Ibarra Corretgé

Links