7 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
MicroQuickJS (MQuickJS) is a compact JavaScript engine designed for embedded systems, requiring only 10 kB of RAM and 100 kB of ROM. It supports a strict subset of ES5 JavaScript and features a unique memory management system with a tracing garbage collector. The engine allows for efficient execution and bytecode generation for resource-constrained environments.
If you do, here's more
MicroQuickJS (MQuickJS) is a lightweight JavaScript engine designed for embedded systems. It operates with minimal resources, requiring only 10 kB of RAM and about 100 kB of ROM. Although it shares some code with QuickJS, MQuickJS has a different architecture to reduce memory usage, including a tracing garbage collector and UTF-8 string storage. The engine focuses on a subset of JavaScript that aligns closely with ES5, enforcing stricter coding practices to avoid common errors and inefficient constructs.
The engineβs REPL is accessible via the command-line tool `mqjs`, which supports various options for script execution, bytecode compilation, and memory management. For instance, you can limit memory usage or save compiled bytecode to a file. The bytecode format adapts to the CPU's endianness and word length, allowing 32-bit bytecode generation for compatibility with 32-bit systems. MQuickJS does not support all JavaScript features; for example, it disallows array holes and restricts the use of `eval` to global scope only.
MQuickJS minimizes dependency on the C library, allocating memory from a provided buffer instead of using dynamic memory management. The engine's C API is similar to QuickJS but requires different handling due to its compacting garbage collector. Users should avoid storing `JSValue` variables directly, as their addresses can change during memory allocation. The standard library is compiled into fast-access C structures, optimizing its footprint in RAM while enabling execution from ROM. MQuickJS also includes a basic mathematical library and a floating-point emulator for CPUs lacking native support.
Questions about this article
No questions yet.