Something I wonder about is if there is mature tooling for passing structs through the WASM to JS boundary by having JS code directly access the WASM heap in accordance with some ABI that the WASM code conforms to.
There’s not, AFAIK. This was called “interface types” at one point, but the development has become very convoluted and broken in to smaller parts, none of which are sufficient to do zero-copy structured memory passing alone.
Isn’t that achieved by any portable object format like Protobuf, JSON or CBOR?
I was thinking more like zero copy, with the objects on the JS side being a pointer to the Wasm heap and an index into it.
JSON, PB and CBOR involve more copies.
The other day, someone asked what Zig’s niche was. It’s really hard for any new language to catch on. It helps to have some limited area where it’s best in class and then branch out from there. I wonder if WASM could be an opportunity for Zig. WASM needs some kind of no-std, memory-managed-but-not-painful tech. Seems like a fit for Zig? Rust is the other obvious choice, but I think Rust is sort of moving in a different direction ATM.
This sounds like an instance of “finding a problem for the solution”.