Programming in MicroPython is interesting, in multiple ways.
If you're not familiar with it, it's a port of the Python language to run on very small systems - primarily microcontrollers of various types. Programming for any of these types of systems, in any language/environment, always poses some challenges because of the limited resources. Forget 32-bit machines limited to 1GB of user-mode address space - think 256 KB of RAM being unimaginably vast for many MCUs, even today.
They did a pretty amazing job getting Python to run on these MCUs. It even supports a lot of the standard library, with restrictions, limits, and various missing bits an unavoidable side-effect.
The specific things that have tickled me about it recently include:
* Missing stdlib modules that a modern Python programmer just takes for granted.
* Don't do more than basic type hints / annotations, because MicroPython won't like them.
* Get used to running into out-of-memory errors if you build lots of complex data structures at runtime.
* Some of the more modern features and syntax aren't supported.
It actually feels kind of like programming in Python 1.1 or so did. I haven't checked, but it wouldn't surprise me if exceptions were strings 😉
#MicroPython #Python #microcontroller #MCU #software #programming #resources #nostalgia #exceptions