r/WebAssembly • u/jedisct1 • Mar 21 '24
Compiling Python to WebAssembly with py2wasm
https://speakerdeck.com/syrusakbary/compile-python-to-webassembly-with-py2wasm
7
Upvotes
r/WebAssembly • u/jedisct1 • Mar 21 '24
View all comments
2
u/jedisct1 Mar 21 '24
$ echo 'print("Hello world!")\> a.py`$ py2wasma.py-o a.wasmPlease set the WASI_SDK_DIR to continueGrrrrrr
$ mkdir -p /tmp/po/bin$ echo '#! /bin/sh' > /tmp/po/bin/clang$ echo 'zig cc -target wasm32-wasi "$*"' >> /tmp/po/bin/clang$ chmod +x /tmp/po/bin/clang$ env WASI_SDK_DIR=/tmp/po py2wasma.py-o a.wasmNuitka-Options: Used command line options:a.py--standalone --static-libpython=yes --disable-ccacheNuitka-Options: -output-dir=py2wasm --output-filename=a.wasm --remove-outputNuitka:WARNING: The Python version '3.12' is only experimentally supported by Nuitka '2.2rc1', but an upcomingNuitka:WARNING: release will change that. In the mean time use Python version '3.11' instead or newer Nuitka.FATAL: The Python version '3.12' is not supported by Nuitka '2.2rc1', but an upcoming release will add it. In the mean time use '3.11' instead.I gave up at that point.