News for hackers. Stuff that matters.
Re:Reality Check for Cloudflare Wasm Workers and Rust by Matthias247 on Saturday September 18, 2021 @01:56PM (#28578017)
So how do you fill that arraybuffer from Javascript datatypes (e.g. strings which describe the request)? The answer is "by copying the relevant data" - which is exactly what the bridging code between JS and WASM does. You can only avoid that if the source data is already plain byte arrays and not javascript objects.
Re:Reality Check for Cloudflare Wasm Workers and Rust by wibagusto on Sunday September 19, 2021 @10:47AM (#28584740)
Hmm I think the answer is that “you don’t”. Unless a module is compiled into WASM that understand the memory representation of the JavaScript runtime the only way for the languages to communicate is at the raw byte array level. The only thing that can be done in that regard is holding pointer/reference to data that will be passed back into JavaScript from WASM.