Minimal JS Runtime

A toy JavaScript runtime based on QuickJS and libuv.

Introduction

This project demonstrates how to build a simplest JavaScript runtime with QuickJS and libuv. Takeaway points include:

  • Native fib function implementation.
  • setTimeout implementation.
  • Support for running microtasks and macrotasks.

See my Chinese blog post for technical details:

Getting Started

Please make sure CMake, QuickJS and libuv are globally installed.

Build the runtime:

cd build
cmake .. && make

Start the runtime:

./runtime

Misc

To find out how to port the original event loop shipped with QuickJS, checkout commit fce26e.

License

MIT