3 ms·
I really want stringref to make a comeback.
by davexunit 7mo ago
I really want stringref to make a comeback.
- spankalee 7mo agoMy god yes. I'm building a new Wasm GC-based language and I'm trying to make as small as binaries as possible to target use cases like a module-per-UI-component, and strings are the biggest hinderance to that. Both for the code size and the slow JS interop.
- davexunit 7mo agoYeah it's really frustrating and JS string builtins are not a good fit for me as I do not want to deal with 16-bit code units.
- dfabulich 7mo agoWho killed stringref and why?
- davexunit 7mo agoIt couldn't get past a vote in the Wasm community group to advance from phase 1 to phase 2. Here's a quote from the "requiem for stringref" article mentioned above: > 1. WebAssembly is an instruction set, like AArch64 or x86. Strings are too high-level, and should be built on top, for example with (array i8). > 2. The requirement to support fast WTF-16 code unit access will mean that we are effectively standardizing JavaScript strings.
- wffurr 7mo agoCan you use WTF-16 for strings in your language?
- spankalee 7mo agoI have a compiler flag to switch from wtf-8 and wtf-16 so if you compiler for your host you don't have to reencode strings. That means that strings in my language hide their byte representation, don't allow indexed access, and only have code point iterators.
- deleted 7mo ago[deleted]