Pikascript: An ultra-lightweight Python engine that can run in 4Kb of RAM
github.com
github.com
The bottom of the readme indicates the list of control flow instructions it supports, but it would be convenient to have in the table the ones it doesn't as well: yield, yield from, with, try/excep, match, lambda...
Does it support "else" in loops? Does it support unpacking?
Hard to know how much Python does this Python does.
Good luck to the project though.
Totally true. Some people would like to contribute to the project, and knowing what's lacking is a good way to make people know how to help.
It’s super fun to use the built in interpreter over serial connection with say a Raspberry Pi Pico.
Another step down is snek, where complete interpreter code can fit in 64KB. Although, this is a much more constrained subset of python (for example - yes dictionaries, no list comprehensions): https://sneklang.org/
PikaScript appear to be even more compact at 32KB code (and is even smaller subset of the language)
Pikascript could be useful, but it seems to me it's either a castrated Python, or more positively, a minimalist embedded scripting environment with Python-like syntax. But it's not Python.
But yeah so much of the standard library relies on dictionaries, so it wouldn't feel very pythonic.
[1] https://nicksypark.medium.com/the-feasibility-of-the-embedde...
Picbit ran in 256bytes, it's descendent is slightly larger https://github.com/stamourv/picobit
Staapl compiles scheme to Forth, to also run on the PIC18 https://www.concatenative.org/wiki/view/Staapl
Of course there is also Sectorlisp, the smallest language out there in 436bytes, 64k ram https://justine.lol/sectorlisp2/
"A typical microcontroller used with the Moddable SDK has about 45 KB of free memory, 1 MB of Flash ROM, and runs at 80 MHz. The Moddable SDK uses many different techniques, both at build time and at run time, to work efficiently on these devices."
Edit: Turns out the official project's claim is indeed 4KB so the title is just bogus.
1kb = 1000 bits
1Kib = 1024 bits
1kB = 1000 bytes
1KiB = 1024 bytes
Obviously in practice nobody uses the decimal ones.
So, anyone who uses Windows has probably noticed at some point that "GB" "MB" and "KB" are the power-of-2 variants. Whenever I see one of those tech YouTubers say the formatted capacity of a 1 "TB" drive is 931 "GB" I just cringe. Most storage vendors use the power-of-10 definitions and Windows uses the power-of-2 definitions. 10^12 bytes / 2^30 = 931.32, so no, formatting your drive does not make 7% of the space just disappear.
A nice migration path for existing Python apps to eventually be rewritten in leaner languages.
Pika: cute fluffy bunnymouse
Pica: the desire to eat inedible stuff