Great video! I've been working with this stuff for several months now. I wish this video existed back then, I struggled a bit to get all this working. One convenient thing I am doing is `lib.rdynamic = true` instead of `lib.export_symbol_names`, since it will export all functions marked with `export` without having to explicitly list them, which is normally what I want. And for reference in the future when people move to Zig 0.12.0: We won't be using `const lib = b.addSharedLibrary` but `const exe = b.addExecutable` and then setting the `exe.entry = .disabled`.
Very helpful content, Dude! Hope the zig team will move towards wasip2 as well. BTW, do you remember which color theme you are using in your editor here?
wasm32-wasi seems to work fine for me both in node and in the browser (firefox on Fedora 39). Is that not expected? when I use wabt to generate the wat file it shows the same exact code for .ReleaseSmall whether I target wasm32-wasi or wasm32-freestanding. Anybody else see something different?
If the functions in the library don't do anything specific to WASI like I/O or other system calls, I think the generated WASM modules will indeed be the same. They're just pure functions which behave the same in all host environments.
Great video! I've been working with this stuff for several months now. I wish this video existed back then, I struggled a bit to get all this working.
One convenient thing I am doing is `lib.rdynamic = true` instead of `lib.export_symbol_names`, since it will export all functions marked with `export` without having to explicitly list them, which is normally what I want.
And for reference in the future when people move to Zig 0.12.0:
We won't be using `const lib = b.addSharedLibrary` but `const exe = b.addExecutable` and then setting the `exe.entry = .disabled`.
Thanks for the great tip on lib.dynamic and the heads-up on what's coming in 0.12. Zig keeps moving in fast forward! lol
thank you so much for this! I was stuck
Very helpful content, Dude! Hope the zig team will move towards wasip2 as well. BTW, do you remember which color theme you are using in your editor here?
Thanks! It's tokyonight . Specifically the tokyonight-night variant bundled in the theme. I find it easy on the eyes. :^)
Really great walkthrough! Would love to know what you think of Extism btw, which has great Zig and JS support.
Wow, never heard of Extism but just took a quick look and it looks very interesting indeed. Thanks for letting me know!
Great walkthrough!
wasm32-wasi seems to work fine for me both in node and in the browser (firefox on Fedora 39). Is that not expected?
when I use wabt to generate the wat file it shows the same exact code for .ReleaseSmall whether I target wasm32-wasi or wasm32-freestanding.
Anybody else see something different?
If the functions in the library don't do anything specific to WASI like I/O or other system calls, I think the generated WASM modules will indeed be the same. They're just pure functions which behave the same in all host environments.