The problem being discussed is about runtime interoperability between JS (with WTF-16 string format) and WebAssembly.
Python has several internal string representations to reduce conversions.
Really "UTF-16 string" and "UTF-8 string" are code smells. Applications should be using character/code point sequences or byte sequences.
Using code unit sequences is....bizzare. (Yes I know Java, C#, JS has chosen to do that, but a new language has an opportunity to improve.)
``` let foo: string = "whatever" ```
be able to work in any similar sense as TS/JS if? How can that map to multiple string types? The idea is both AS and TS use the same syntax for strings, and are compatible across boundaries (TS for JS side, AS for Wasm side). Having multiple string types is possible, but this would greatly reduce developer ergonomics.
If it's a language, then it gets to decide what ```let foo: string = "whatever"``` means.
If it's a compiler for an existing language, then semantics have already been decided, and the compiler has to implement it.
But none of the precludes abstraction to reduce data type conversions.
I'm not sure what type of compiler to label that as, but that's the goal.
A compiler. From TypeScript to web assembly.
Certainly it has its work cut out for it to have TS semantics (that is, JS semantics) and be optimal for target web assembly.
I can't think of any scripting languages that are optimal for targeting low-level runtimes.
I wish AssemblyScript the best; seems like a hard problem.
I sympathize with pain, but the bleeding edge of tech does...bleed.
P.S. the web will never switch to UTF-8. It would break too many web pages. Most browser vendors won't even accept breaking 0.1% of web pages, unless they're doing it to show you more ads (i.e. Chrome).