-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support toWtf8Array #10
Comments
Generally +1 to adding instructions that are useful, so I'm supportive of this request. I don't feel strongly about the details, and don't think they're worth worrying about: if we go for |
Actually, when measuring the size of the result array, if one detects that the string contains only ASCII characters, one can directly use Indeed, we need a Wasm GC array type which is not associated to any module. Current Wasm GC implementations probably does not expect that. |
That's totally fine, the meaning of structural types is independent of modules, resp. module instances. |
I believe this is now fixed with the introduction of the text-encoder/text-decoder namespaces. |
For languages that represent their strings as
(array i8)
internally, it would be good if there were an accelerated primitive for JS string -> wasm string conversion. In that case we would needtoWtf8Array
.encodeWtf8Array
, as in stringref, would be the more general version, buttoWtf8Array
could be faster (doesn't require a priormeasureWtf8
) and covers some likely use-cases.The text was updated successfully, but these errors were encountered: