Running Python code from with PROS

Just wondering if it is possible to run code on the Python VM from a PROS program. This is because my team wants to be able to code some stuff in Python so that everyone can contribute to it, while we also want to take advantage of LVGL and other features of PROS. Has anyone done such a thing before, and do you think it is worth the effort to do this if it is possible?

1 Like

Sorry, not possible.

The Python VM is actually a special user program, so it’s not possible to run at the same time as a PROS program. In addition, the Python VM is part of VEXcode and not available to partner developers.

6 Likes

I do not Know the true answer to that, but as Python is written in C, I think it is plausible to make your own Python compiler. Maybe talk to @DrewWHOOP as I believe he made a Rust compiler, backdriven by the PROS infastructure.

1 Like

Yes, the Python VM that VEXcode uses is a “normal” user program and built against the same SDK that we use in VEXcode (although we do have access and knowledge of certain private APIs that make using it easier). When we run a Python program we use similar techniques to that which PROS uses for the hot/cold parts of a program, we call this a linked program, the ability for one program to load another file into memory before running.

7 Likes

no i didnt, I just linked rust code with the PROS C api, and then Nick Mertin did it better because he is smarter than me.

If you want to use python, your options are probably use Robotmesh or vexcode python (if thats a thing, I dont use vexcode) or learn a different leanguage. Implementing your own python runtime for V5 is definitely possible, but it would be easier to just learn C++.

3 Likes