Hacker News new | ask | show | jobs
by fatihpense 873 days ago
Yes, another valid case is passing heap-allocated pointers between WASM guest and host. I have an example here if anyone is interested: https://github.com/fatihpense/zig-wasm-string-and-struct

As a newbie in low-level programming, being able to return "heap-allocated pointer" instead of "stack-allocated pointer to a struct in heap" was a challenge at first :) But I love how everything is explicit in Zig.