Post ASIH4b7UJcBKwiXkYK by patricia_gerstenberger@mastodon.world
 (DIR) More posts by patricia_gerstenberger@mastodon.world
 (DIR) Post #ASHX0RLW7GNVaFBWHA by simon@fedi.simonwillison.net
       2023-02-02T21:39:30Z
       
       1 likes, 0 repeats
       
       Thanks to @pims I finally have code that successfully runs untrusted Python code inside a WebAssembly sandbox inside a wrapper Python script!It's using wasmtime-py as the WebAssembly runtime, and the new build of Python-compiled-to-WebAssembly that VMware put out the other dayhttps://til.simonwillison.net/webassembly/python-in-a-wasm-sandbox
       
 (DIR) Post #ASHXFTNWqFlWENIHo0 by simon@fedi.simonwillison.net
       2023-02-02T21:40:41Z
       
       0 likes, 0 repeats
       
       @pims It would be great if this could work without having to set up temporary files to capture stdout / stderr from the untrusted Python code, but this is still a HUGE step forward to being able to implement robust sandboxed Python in a portable way using WebAssembly
       
 (DIR) Post #ASHXh3TgjWkE0fKLoW by cohix@hachyderm.io
       2023-02-02T21:46:52Z
       
       0 likes, 0 repeats
       
       @simon excellent
       
 (DIR) Post #ASHYER0AIF5QWXR0BU by bat@fosstodon.org
       2023-02-02T21:53:08Z
       
       0 likes, 0 repeats
       
       @simon @pims Nice! The VMWare Python build is really tiny but it looks like it makes a big difference from other builds! I had missed a key part in that repo which is their sqlite library. Also tiny but looks highly effective. I'll have to give it a shot!Here's the sqlite build that I missed the first time I looked at it: https://github.com/vmware-labs/webassembly-language-runtimes/tree/main/libs/sqlite
       
 (DIR) Post #ASHZ3RLmkxBaNFrusa by pims@hachyderm.io
       2023-02-02T22:02:08Z
       
       0 likes, 0 repeats
       
       @simon I agree, it’s a bit awkward right now. It was my first look at wasmtime-py, so I might have missed something. With a go runtime, it’s trivial to pass a buffer as a stdout replacement. Might be worth creating an issue on Github.
       
 (DIR) Post #ASHZNNbSOk8CXmhsuG by pims@hachyderm.io
       2023-02-02T22:04:11Z
       
       0 likes, 0 repeats
       
       @simon on a personal note: Your blog had a big impact on my early career, so  I’m glad this was useful. 🙂
       
 (DIR) Post #ASHlYCk6JhBzUng6D2 by simon@fedi.simonwillison.net
       2023-02-03T00:22:31Z
       
       0 likes, 0 repeats
       
       @pims good idea, opened an issue here https://github.com/bytecodealliance/wasmtime-py/issues/123
       
 (DIR) Post #ASIH4b7UJcBKwiXkYK by patricia_gerstenberger@mastodon.world
       2023-02-03T06:15:40Z
       
       0 likes, 0 repeats
       
       @simon @pims I m happy there are people like you in the world who understand what you just said. I'm not one of them. Power on, my friend.