3 ms·
This would still require conversion from and to Javascript strings, and doesn't help with any language compiled to WASM that isn't Rust. And it probably wouldn'
by flohofwoe 5y ago
This would still require conversion from and to Javascript strings, and doesn't help with any language compiled to WASM that isn't Rust. And it probably wouldn't even help Rust because such a native WASM string type would presumably live outside the WASM heap (because if the string data would be on the WASM heap, there's no need for a native string type).
- mamcx 5y agoAny complex structure past int/floats requiere conversion. Heck, even floats and ints (for example: oCalm and anybody with more/less bits than JS). So, given this is a fact, the best course of action is chosen the most safe alternative. And for everyone else? Well an array of bits ant let the host/callers that are the only that know their own stuff deal with it. INCLUDING Js.
- brabel 5y agoI don't know what you're arguing about. The interface types proposal defines a string like this: string ≡ (list char) char is defined to be a Unicode scalar value (i.e., a non-surrogate code point). Basically, this is "the most safe alternative"??!
- mamcx 5y agoI was arguing against the idea of "string are implemented differently by different languages, so WHICH one choose?". A safe one. Your sample is that - except I think is better if is a utf-8 string, but this one works for me too-. What will be worrisome is if is made to be like in C.