donny681 / quickjs-uv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About


Languages

Language:C 50.9%Language:Makefile 21.0%Language:C++ 15.3%Language:CMake 12.4%Language:JavaScript 0.5%