Hacker News new | ask | show | jobs
by robertlagrant 1237 days ago
The non-Docker version seems to require an external site-packages, unless I missed it. Is it possible to produce a single wasm binary with all dependencies compiled in?
2 comments

Hey! Dev here :)

For external libraries, it requires you to mount the libraries with WASI when running the python.wasm module. Another option we're exploring is to use wasi-vfs[1] to include some common modules in our pre-built binaries. For example, Ruby does require some extra libraries for common workloads (like JSON parsing). This is still on the exploration phase, but we may do something with it.

[1] https://github.com/kateinoigakukun/wasi-vfs

Very cool. We ship some Python as a Debian dependency and so this could become a really interesting way to package everything up.
I have been following and playing with this repository: https://github.com/singlestore-labs/python-wasi/

It builds a single Python WASM module with all dependencies included (they use VFS) and a Dockerfile to make the process easy (and actually worked first go). It does produce large files though: wasi-python3.11.wasm 110MB

Yes! Single store is a great team. We are currently using some of their work for this Python release, like libz