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`.
@dudethebuilder
8 ай бұрын
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
@nilslice
8 ай бұрын
Really great walkthrough! Would love to know what you think of Extism btw, which has great Zig and JS support.
@dudethebuilder
8 ай бұрын
Wow, never heard of Extism but just took a quick look and it looks very interesting indeed. Thanks for letting me know!
@jedisct1
4 ай бұрын
Great walkthrough!
@klmcwhirter
8 ай бұрын
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?
@dudethebuilder
8 ай бұрын
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.
Пікірлер: 9