Skip to content

fromWtf8Array with no start/length parameters ? #9

Open
@wingo

Description

@wingo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions