My blog post: Building a Runtime with QuickJS
A tiny JavaScript runtime in C built on top of QuickJS with with an event loop and a worker pool, with the following APIs:
console.logprocess.uptime()setTimeoutclearTimeoutfs.readFileSyncfs.readFile
See examples/ for JavaScript code examples.
./init.sh # download vendored quickjs source
make # builds ./andjs
./andjs examples/example-read-file-async.js # run some js!There are also some benchmarks against Node.js.
./benchmark.sh # ran on M1 Pro, Node.js v24.14.0
tmpdir: /var/folders/61/lbcm8sq51g7fjcvsk6hhz0q00000gn/T//andjs-bench.QmMzJq
files: 10 x 1 MiB UTF-8 text
iterations: 10
Overall time (includes startup):
node 38.9 ms ± 1.0 ms
andjs 6.9 ms ± 0.4 ms
andjs is 5.67x faster overall
File-read portion:
node 4.242 ms
andjs 4.754 msAlso, tests.
./init.sh
./test.sh