9 points erikkaum | 3 comments | | HN request time: 0.637s | source

A while ago I started experimenting with compiling the Python interpreter to WASM. To build a secure, fast, and lightweight sandbox for code execution — ideal for running LLM-generated Python code.
1. erikkaum ◴[] No.42183305[source]
The idea came when tinkering with WASM+WASI and realizing that you can compile the Python interpreter to wasm32-unknown-wasi, and run it in a WASM sandbox. It's an experimental Rust server that executes Python code. I've always been amazed by the Cloudflare Workers runtime, which builds on the V8 engine. You can think of this as an aspiration to build something:

- with similar startup times (and maybe similar memory footprint) - that's not only for JavaScript - open-source for you to run locally and tinker with

Happy hacking!

2. Mockapapella ◴[] No.42186193[source]
Looks really cool! Might try this out with some projects