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

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

PikaScript provides a subset of the Python 3 language that supports syntax elements such as branch and loop statements (if, while, for, else, elif, break, continue), base statements (+ - * / < == >), modules, encapsulation, inheritance, polymorphism, classes and methods. Python scripts are executed on devices after precompilation - PikaScript first converts Python code into internal Pika Asm bytecode, which is executed on the end device in a special Pika Runtime virtual machine. Work directly on top of the hardware or in RT-Thread, VSF (Versaloon Software Framework) and Linux environments is supported.

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

Separately, the ease of integration of PikaScript scripts with code in the C language is noted - functions written in the C language can be attached to the code, which allows using the developments of old projects written in the C language when implementing PikaScript. C modules can be developed using existing development environments such as Keil, IAR, RT-Thread Studio, and Segger Embedded Studio. Bindings are generated automatically at the compilation stage, it is enough to define the API in the file with the Python code and the binding of C functions to Python modules will be performed during the launch of the Pika Pre-compiler compiler.

PikaScript 1.8 is 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 quickly start development without hardware, a simulator is provided or a Pika-Pi-Zero development board is offered based on the STM32G030C8T6 microcontroller with 64 KB Flash and 8 KB RAM, supporting common peripheral interfaces (GPIO, TIME, IIC, RGB, KEY, LCD, RGB) . The developers have also prepared an online project generator and a PikaPackage package manager.

The new version implements reference-counted memory management and adds support for virtual constructors (factory method). Diagnosis of memory problems was carried out using the valgrind toolkit. Added support for compiling Python pc-files into bytecode and packaging into firmware. Implemented the ability to use multiple Python files in the firmware without the need to use the file system.

Source: opennet.ru

Add a comment