Skip to content

Array data structures should keep their lengths encoded #136

@dvanhorn

Description

@dvanhorn

Our current layout for strings and vectors is to store their unencoded length in the first word, but there's really no good reason doing it this way it and it means you have to re-encode it when you access the length. I think this was originally done to make bounds checking simpler to understand, but it's basically the same encoded or not. Changing this would simplify the code a bit.

Arguably the same should be done for the character data in strings. We have the bits available, so using codepoints doesn't buy you anything except the work of de/re-coding.

It's technically possible to pack 3 codepoints per words (but not chars), but we don't do that.

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