Description
Hi all,
I am currently learning Rust+WebAssembly and I came across a common problem. When accessing the memory
of my wasm application from JavaScript I use Uint8Arrays and so on which, works fine most of the time. But this becomes quite complex when I have a struct or even an Vec
of structs in my memory. For now, I am extracting the fields of the structs manually by utilizing e.g. Uint8Arrays but I was wondering if there is a more convenient way of doing this? Did I miss something there or is there an easier approach?
What I have in my mind is something like an automatically generated JavaScript class based on the struct in Rust that you can pass a pointer to. This class might be just a wrapper around accessing the memory parts directly, but it would be nice to have.
Is there something similar to this already there?
Oh and btw: If this is anyhow helpful for you, I assembled a Docker image with all the tools installed for doing the "game of life" tutorial including the new wasm32-unknown-unknown toolchain. You can find it here https://hub.docker.com/r/jibbow/rust-wasm32-unknown-unknown/