You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My understanding is that the interface to fromWtf8Array was taken from stringref, where the use case might be, you have a buffered I/O port with an (array i8) holding your bytes, and you want to decode a part of that buffer. In that case it definitely makes sense to take a start and an offset.
However for wtf-8 string conversion on the boundary, for languages that use UTF-8 or WTF-8 internally -- i.e., where you're not using externref to actually represent the strings, but instead you are using the JS string builtins to perform a more efficient encode/decode when communicating with the host -- there, you are much more likely to just have a full (array i8). You will be decoding the whole thing. In that case binary size and runtime overhead will be minimized if we can remove the start and end arguments, and just assume we transcode the whole buffer.
The text was updated successfully, but these errors were encountered:
My understanding is that the interface to
fromWtf8Array
was taken from stringref, where the use case might be, you have a buffered I/O port with an(array i8)
holding your bytes, and you want to decode a part of that buffer. In that case it definitely makes sense to take a start and an offset.However for wtf-8 string conversion on the boundary, for languages that use UTF-8 or WTF-8 internally -- i.e., where you're not using
externref
to actually represent the strings, but instead you are using the JS string builtins to perform a more efficient encode/decode when communicating with the host -- there, you are much more likely to just have a full(array i8)
. You will be decoding the whole thing. In that case binary size and runtime overhead will be minimized if we can remove the start and end arguments, and just assume we transcode the whole buffer.The text was updated successfully, but these errors were encountered: