Skip to content

Core type names and keywords for string types #5969

@zygoloid

Description

@zygoloid

Summary of issue:

What should the names we use in Core for string view and string buffer types be? What should the corresponding keywords be, if any? Should we also have a type for a nul-terminated string view, and if so, with what name?

Details:

We discussed this during the 2025-07 Carbon summit. The leading option seemed to be:

  • String view type: Core.Str with keyword alias str
  • String buffer type: Core.StrBuf with keyword alias str_buf

The toolchain has reached the point where it needs an answer for its implementation. We should establish a leads position on this question.

Any other information that you want to share?

For a nul-terminated string view type, Core.CStr or Core.ZStr might be good choices.

Another possible option would be to spell the Core. names out in full: Core.String and Core.StringBuffer / Core.StringBuf.

A related question is what name we use for our contiguous dynamically-sized array type, for which the leading contender currently is Core.Buf with keyword alias buf.

Metadata

Metadata

Assignees

No one assigned

    Labels

    leads questionA question for the leads team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions