Re:Rocket – A Rust game running on WASM
by kayoone on Monday December 04, 2017 @07:53AM
(#15843433)
so you can only pass simple types and nothing like a framebuffer array ? great work btw!
[ Parent
| on HN ]
Since WASM in its current state is meant as a compilation target for C, it is usually possible to do things "the C way". For instance, you can allocate a buffer on the Javascript side and pass a pointer to the Rust side, which then can write to it. You can also allocate it on the Rust side and return it. This is for instance what you do when you want to return a string.