Stream: beginners

Topic: Zig WASM platform


view this post on Zulip Samuel (Jul 01 2025 at 18:37):

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!

view this post on Zulip Anton (Jul 02 2025 at 09:01):

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