Web Assembly handle strings as arrays of integers
I'm afraid I may have some startling news.
Web Assembly handle strings as arrays of integers
I'm afraid I may have some startling news.
I'm really interested if you have some news about this very topic. Seriously!!! Handling strings was really a hassle in WASM and if there is now a better solution I'm really excited to this prospect.
Do yo have any pointers?
Sorry, my news was slightly tongue in cheek. Any assembly-like solution ultimately treats strings that way.
Well, probably more like sequences of bytes.
Not exactly. Javascript strings are encoded as UTF-16 characters. Each element in this array of integers is a UTF-16 code point... So basically most characters are encoded on int16_t, except for very large codes, such as emojis, which are usually implemented on two int16_t.