2 ms·
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
by Matthias247 5y ago
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.
- wibagusto 5y agoHmm 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.