3 ms·
I am a bit in need for help here. Why does string matter to webassembly? Shouldn't be possible to implement any string type on top of it? Is it really required
by a1o 3y ago
I am a bit in need for help here. Why does string matter to webassembly? Shouldn't be possible to implement any string type on top of it? Is it really required for it to have some special handling for strings?
I am used to C and C++ so I guess I never thought of wasm as a runtime like C#+.NET so any help is appreciated.
- Skinney 3y agoIt is possible to implement your own strings by only using WASM primitives. There are two, as I see it, major reasons for including specialized support for it anyway: 1. One of the biggest WASM runtimes are browsers, and so it's likely that one would want to exchange strings between WASM and JS/DOM _efficiently_ 2. The article states that most modern languages, if compiled to WASM, would likely need a lot of functionality in order to deal with unicode correctly (was how I interpreted the reference to libICU), which again would greatly increase the size of WASM blobs for those languages. Having stuff like that builtin would mitigate that.