Skip to content

FFI: split Symbol's name and byte-value roles #90

Description

@aoinoikaz

One Symbol newtype carries two data classes across the FFI: UTF-8-encoded names (written with symbolIntern, read with symbolText) and raw byte string-values (written with symbolInternBytes, read with symbolBytes). Every read site currently selects the right accessor by the C value tag - convention, not type - and symbolText on a byte-value symbol would silently substitute replacement characters rather than fail.

Splitting the roles (phantom-tagged Symbol Name / Symbol Bytes, or two newtypes over the same interned representation) makes the accessor choice a type error instead of a convention, at zero runtime cost. Touches the symbol module, the thunk read paths, and the context-string marshalling.

From the #85 audit (FFI subsystem).

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