Would anyone happen to have an example to point towards of how to marshal strings in JS into a []u8 in Zig, and how to allocate and return a []u8 from Zig back to JS? I'm ideally hoping that someone has the string version of https://github.com/meheleventyone/zig-wasm-test/ somewhere where I could then template off of?
I've searched and found some of the related questions before (most usefully #zig-help-deprecated message), but between zig strings being weird (export requires [*]u8, which I don't otherwise use?), my unfamiliarity with the WASM/JS model, and what to do with zig's allocator, I've been struggling.
(My variety of searches tell me that I think I basically want the zig version of wasm-bindgen for rust?)
A minimal Web Assembly example using Zig's build system. - GitHub - meheleventyone/zig-wasm-test: A minimal Web Assembly example using Zig's build system.
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.