I gave this a spin a while back but, unfortunately didn’t get very far since the software and dependencies have grown long in the byte. Since then, I’ve found RustPython [0] which is progressing toward feature parity with CPython but entirely written in Rust (!). A side benefit is that it compiles to Web Assembly, so if you could sandbox it without too much extra overhead.
Since a lot of CPython’s power comes from its C API (think for example NumPy), this is unfortunately pretty far from feature parity with CPython, unless I’m missing something.
This. Native python is very slow so almost any compute heavy python work will offload work to external native code. While the a RustPython would help on the python side, this wouldn't help the external native calls which end up doing most of the work.
> Since then, I’ve found RustPython [0] which is progressing toward feature parity with CPython but entirely written in Rust (!). A side benefit is that it compiles to Web Assembly, so if you could sandbox it without too much extra overhead.
> Pyodide brings the Python runtime to the browser via WebAssembly, along with the Python scientific stack including NumPy, Pandas, Matplotlib, parts of SciPy, and NetworkX. The packages directory lists over 35 packages which are currently available.
Is the RustPython WASM build more performant or otherwise preferable to brython or pyodide?
This is part of Baidu X-Lab's efforts to make MesaLock Linux (https://github.com/mesalock-linux). They are creating memory safe versions of tools for their distribution.
How does this handle “pip install” and third party code? It seems the memory safety guarantees depend on reimplementing things in Rust (for stdlib modules), which would be interesting in and of itself, as well as formal verification.
[0] https://github.com/RustPython/RustPython