ELK project develops a compact JavaScript engine for microcontrollers

Available New release JavaScript engine ELK 2.0.9 , aimed at use in systems with limited resources, such as microcontrollers, including ESP32 and Arduino Nano boards with 2 KB RAM and 30KB Flash. For the work provided by the virtual machine, 100 memory bytes and 20 kb of the accumulator are sufficient. The project code is written in Si language and extends under the GPLv2 license. For the project assembly, the SI compiler is enough – additional dependencies are not used. The project is developing by the developers of the operating system for IoT devices Mongoose OS , embedded HTTP server Mongoose and JavaScript engine mjs .

The main destination ELK is the creation of firmware For JavaScript microcontrollers that perform various automation tasks. The engine is also suitable for embedding handlers in JavaScript in applications on C / C ++. To use the engine in its code, it is sufficient to put the ELK.C file in the source text tree, connect the ELK.H header file and use the JS_EVAL call. A call is allowed from JavaScript scenarios of functions defined in code on C / C ++, and vice versa. Javascript code is performed in a secure and isolated area of ​​surroundings using an interpreter that does not generate a bytecode and not using dynamic memory allocation.

The ELK is implemented small, but sufficient to create work scenarios, a subset of the ECMAScript Specification 6. In particular, a basic set of operators and types is supported, but there is no support for arrays, prototypes, this, new and delete expressions. Instead of VAR and Const, it is proposed to use LET, and instead of Do, Switch and For – While. The standard library is not provided, i.e. There are no such objects
Date, Regexp, Function, String and Number.

/Media reports.