PikaScript 1.8 is now available, a variant of the Python language for microcontrollers

The release of the PikaScript project 1.8 has been published, which develops a compact engine for writing applications for microcontrollers in Python. PikaScript is not tied to external dependencies and can run on microcontrollers with 4 KB of RAM and 32 KB of Flash, such as the STM32G030C8 and STM32F103C8. In comparison, MicroPython requires 16 KB of RAM and 256 KB of Flash, while Snek requires 2 KB of RAM and 32 KB of Flash. The project code is written in C and is distributed under the MIT license.

PikaScript provides a subset of Python 3, supporting syntax elements such as branching and loop operators (if, while, for, else, elif, break, continue), basic operators (+ — * / ), modules, encapsulation, inheritance, polymorphism, classes, and methods. Python scripts are executed on devices after pre-compilation — PikaScript first converts Python code into internal Pika Asm bytecode, which is executed on the target device in a specialized virtual machine Pika Runtime. It supports operation directly on hardware or in RT-Thread, VSF (Versaloon Software Framework), and Linux environments.

PikaScript 1.8 is now available, a variant of the Python language for microcontrollers

Notably, the ease of integration of PikaScript scripts with C code is highlighted — C functions can be bound to the code, allowing for the use of existing resources from older projects written in C when implementing PikaScript. Existing development environments such as Keil, IAR, RT-Thread Studio, and Segger Embedded Studio can be used for developing C modules. Bindings are generated automatically at the compilation stage; it is sufficient to define the API in the Python code file, and the binding of C functions to Python modules will occur during the execution of the Pika Pre-compiler.

PikaScript 1.8 is now available, a variant of the Python language for microcontrollers

PikaScript claims support for 24 microcontrollers, including various models of stm32g*, stm32f*, stm32h*, WCH ch582, ch32*, WinnerMicro w80*, Geehy apm32*, Bouffalo Lab bl-706, Raspberry Pico, ESP32C3, and Infineon TC264D. To facilitate rapid development without hardware, a simulator is provided, or the Pika-Pi-Zero development board based on the STM32G030C8T6 microcontroller with 64 KB of Flash and 8 KB of RAM is offered, supporting standard peripheral interfaces (GPIO, TIME, IIC, RGB, KEY, LCD, RGB). Developers have also prepared an online project generator and the PikaPackage package manager.

The new version includes memory management based on reference counting and adds support for virtual constructors (factory method). Diagnostics for memory issues have been conducted using the valgrind tool. Support for compiling PC Python files to bytecode and packaging them into firmware has been added. It is now possible to use multiple Python files in firmware without the need for a filesystem.

Source: opennet.ru

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