Hi, I would like to call a Roc function from Javascript in the browser. My understanding is that there's no way to build Roc without a platform. I read that Zig should produce the smallest possible WASM bundle. I didn't find any example of a Zig WASM platform. I found some Rust WASM platforms (joy, galena), but so far I wasn't able to modify them for my use case. So, is there maybe some example I missed? And is my assumption about Zig being the best choice correct? Thanks!
Hi @Samuel,
So, is there maybe some example I missed?
No, I don't think we have any up to date zig wasm examples.
I read that Zig should produce the smallest possible WASM bundle.
This is not my area of expertise but for https://www.roc-lang.org/repl we have basically the whole rust compiler in a 2.3 MiB tar.gz so I think you'll be alright with Rust :)
I found some Rust WASM platforms (joy, galena), but so far I wasn't able to modify them for my use case.
What was the problem here specifically?
Last updated: Jul 05 2025 at 12:14 UTC