Zerynth Vs Micropython


#1

Hi,

I recently saw a lot of posts around the web asking about the differences between Zerynth and Micropython.

I am using Zerynth but I need to say that I am getting confused.

Can you better clarify the differences between Zerynth and Micropython?




#2

Hello @Roberto,

Interesting question. I think I already answered somewhere, but time has passed since and Zerynth grew quite a lot in the meantime. 

I believe the main differences between MicroPython and Zerynth can be summed up like this:

  • Zerynth has a smaller footprint

    • 60k-80k of flash, 3-5k ram versus 80k-280k of flash and 8k of ram for MicroPython (see here). Such footprint is achieved by writing the VM from scratch and choosing to remove the compiler and the repl from the microcontroller; to keep VM code at minimum the Zerynth uplinker has been developed; it is a firmware uploader that also links object code on the fly. This allows to flash a minimal VM on the microcontroller once and subsequently add to it only the necessary drivers embedded in bytecode.

  • Zerynth features a RTOS for multithreading

    • In Zerynth each Python thread is a RTOS thread managed by a priority aware realtime scheduler; in MicroPython, as far as I understood, there is a custom round robin scheduler. Moreover in Zerynth, RTOS threads written in C can live along the VM allowing for a mixed C/Python realtime environment. Lastly, any RTOS can be supported: at the moment Zerynth runs on ChibiOS and FreeRTOS, more will be added as needed.

  • Zerynth supports C-Python programming

    • Existing C code (or C object code) can be easily mixed with Python scripts without VM recompilation. For example, the Broadcom SDK for the Particle Photon is embedded in bytecode and uplinked to a running VM; Existing C code can be included in MicroPython too, but a VM recompilation is needed.

  • Zerynth has a cross-platform IDE built on a command line toolchain

    • Zerynth Studio takes away the burden of compiling the VM, of setting up various toolchains and tools (arm gcc, xtensa gcc, etc…) and gives an easy to use interface to code and debug embedded Python. For MicroPython no official IDE does exist;

    • Zerynth is based on a command line toolchain to ease and automate the integration of the Zerynth workflow for programmers who prefer other development environments

  • Zerynth supports a subset of Python 3.4 and adds new embedded-friendly features

    • To make Zerynth  suitable for microcontrollers constrained resources, support for generators, context managers and full-fledged closures has been made optional (will be compiled into the VM if needed). Moreover Zerynth has a new type, the shortarray, to handle 16-bit integer arrays. Also, Zerynth exceptions are lean and memory efficient, but still retaining the powerful debugging capabilities of tracebacks. 

  • Zerynth license is different

    • MicroPython is released under a MIT license and is free to use for every purpose. Zerynth VM at the moment is licensed under GPL. However we will soon switch to a different model: all the Zerynth tools will be released under a MIT license, while the VM will become closed source (reasons here). Zerynth is and will be always free to use for educational and teaching purposes, as well as for non-commercial development.

  • Zerynth aims at becoming a complete middleware for the embedded and IoT world

    • Zerynth roadmap includes the development of modules to allow device management and data gathering for major cloud service providers (Microsoft Azure, Amazon AWS, IBM Bluemix to name a few). Support for advanced debugging techniques is also in the queue (Python breakpoints, code annotation, opcode by opcode execution, JTAG support...).

Let's say that Zerynth is Python even more tuned to micros than MicroPython is. A Micro MicroPython  :D

Hope it helps!