The Mozilla developer working on web assembly wrote some good articles on types<p><a href="https://hacks.mozilla.org/2019/08/webassembly-interface-types/" rel="nofollow">https://hacks.mozilla.org/2019/08/webassembly-interface-type...</a>
Maybe it was just me but this felt a bit overly pedantic. Understanding the internals of wasm bindgen is important for understanding how rust handles strings in WASM, but I was expecting a higher level discussion of how strings are passed to WASM.
Due to the the lack of native strings in WebAssembly different Wasm compilers have different memory layouts and string encodings. For example assemblyscript uses ucs2 for the sake fo compatibility with JavaScript. This obliges to carefully work with memory bounds, string length estimation due to difference in host native and guest string encodings.<p>For the specific goal of working with Strings in rust and assemblyscript I've created this project: <a href="https://github.com/onsails/wasmer-as" rel="nofollow">https://github.com/onsails/wasmer-as</a>.
To quote the Medium comment from Masklinn:<p>> Actually, humans generally think in terms of graphemes, which may or may not be composed of multiple Unicode code points (irrespective of the normalization form being used).
Is it unusual for a VM not to have a string (or at least a bytes) type? I have little experience in the space, but it seems clunky. Curious why WASM went this direction.