The founder of QEMU and FFmpeg published the Micro QuickJS JavaScript engine.

French mathematician Fabrice Bellard, the founder of projects like QEMU, FFmpeg, BPG, QuickJS, TinyGL, and TinyCC, has released a new JavaScript engine for embedded systems — Micro QuickJS. This engine can compile and execute JavaScript programs while consuming only 10 KB of RAM. Together with the C library, the engine occupies approximately 100 KB of persistent memory. Compilation of JavaScript to bytecode and separate execution of the bytecode are possible. The project code is written in C and is distributed under the MIT license.

The engine supports a subset of the JavaScript language that is close to the ECMAScript 5 (ES2019) specification but imposes stricter code requirements and disallows the use of certain inefficient or error-prone JavaScript constructs. For instance, global variables must be declared with the keyword "var", the use of "with" is prohibited, arrays cannot have gaps, initialization in declarations like "new Number(1)" is not allowed, and access to local variables from eval is impossible.

The performance of Micro QuickJS is comparable to the QuickJS engine, developed by Fabrice since 2019. Micro QuickJS utilizes part of the code from the QuickJS engine, but the architecture is significantly different and designed for minimal memory consumption. For example, a tracing garbage collector is implemented in Micro QuickJS, while QuickJS uses reference counting. The overhead of the garbage collector is only a few bits for each allocated memory block. A custom allocator is used that does not rely on the library function malloc().

Other differences from QuickJS include: not using a stack; a different internal representation of objects; storing strings in UTF-8 encoding; generating the standard library at compile time and storing it in persistent memory, creating only a few objects in RAM; a parser that is close to QuickJS but does not use recursion; and combining bytecode generation and optimization in one pass (QuickJS performs multiple passes for optimization). the virtual machinePostmarketOS 25.12 has been released, a Linux distribution for smartphones and mobile devices.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster