Stream: general

Topic: Where are people putting `.wasm` files on Unix?


view this post on Zulip Brett Cannon (Jun 03 2026 at 23:16):

I'm working on packaging up the WASI build of CPython and I need to decide where to put python.wasm. Since it isn't a self-contained binary I don't think bin/ is appropriate (I will probably have a bin/python.wasmtime shell script). Where are other people putting .wasm files?

view this post on Zulip Chris Fallin (Jun 04 2026 at 15:40):

in most of our use-cases (FaaS, programmable network hardware) we have a control-plane so the wasms are managed and don't have a canonical Unix path (and I expect most server-side Wasm folks here would be the same?) but...

... my FHS sensibilities at least say that a wasm feels either like a library or like application data, so either $PREFIX/lib/libpython.wasm or $PREFIX/share/python/python.wasm ? Maybe the latter feels slightly more appropriate?

view this post on Zulip Jacob Lifshay (Jun 04 2026 at 20:40):

well, with binfmt_misc on linux, you can just run .wasm files as if they were normal programs, so maybe /usr/bin?

view this post on Zulip guest271314 (Jun 08 2026 at 03:22):

Depends on the context and application. I usually export $HOME/bin to PATH, have wasmtime, wasm-tools, etc. on a USB and symlink the executables and files I use a lot to $HOME/bin. For projects where I'm creating a lot of different .wasm files in a directory, I just leave them there and create .sh files with something like this

#!/usr/bin/env -S /home/user/bin/wasmtime -W gc=y,function-references=y,tail-call=y,exceptions=y /home/user/native-messaging-js2wasm/nm_js2wasm.wasm

Last updated: Jul 29 2026 at 05:03 UTC