3 ms·
When I call WASM functions the types I have available to me are i32/64 and f32/64. There are not other options. Not even byte arrays. If I need to pass strin
by bborud 2y ago
When I call WASM functions the types I have available to me are i32/64 and f32/64. There are not other options. Not even byte arrays.
If I need to pass strings, structs, bytes etc I have to allocate memory inside the WASM instance, serialize the data into this memory, pass the memory offset as a parameter to the function that should operate on it, deserialize the data and then clean up the mess. This is awkward, error prone and risky.
Yes, I do use WASM from a high level language that has automatic memory management. That's why this old fashioned messing about manually with memory allocation and doing pointer arithmetic seems like such a huge step back.
Yes, there are people that make plugin frameworks. And yes, one of the things they have to do is to hold their nose and just accept that this is the ugly reality of using WASM. It doesn't mean that this isn't a terrible design flaw. It is.