Skip to content

Compile Python Scripts On the Go #2709

@timpur

Description

@timpur

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy