-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
I was wondering if it was possible to compile python scripts on the go. The idea would be you can upload a script (.py) file to the board and get the board to compile and save the compiled code. No need to build custom firmware. The compiled script don't need to be loaded into ram and run from flash, just like the firmware and core modules.
The reason is, it would be nice for newbie (me a month ago) who doesn't know the complexity of creating a firmware to be able to have the benefits of frozen scripts (Minimum Ram Usage) without going to the trouble of setting up the SDK.
Having feature would also be awesome because, say you had an IOT device located remotely. You could webrepl into the device, upload a new script (.py) compile it on the board, move it to the lib folder (or something), remove the script (.py) and execute the new compiled script from flash. Now doesn't take any time to compile or use any ram to execute (the script doesn't live in ram, unlike .py scripts)
The saved compiled version could be a .mpy or .pyc, not sure about the details, that's why im asking you, the awesome developers. What do you think of a feature like this and is it possible? Tell me your thoughts.
It would be nice to create "Frozen Scripts" with out creating a custom firmware. Lets use that awesome builtin Interpreter to its full potential.
Functionality:
-
Python Scrips compiled on board and saved as a file in the flash
-
Compiled Scripts execute from flash (no loading into ram)
Outcome:
Minimum Ram Usage for custom scripts.