Skip to content

Conversation

@bricknerb
Copy link
Contributor

@bricknerb bricknerb commented Oct 8, 2025

This proposal defines a direct, zero-cost mapping between C++'s std::string_view and Carbon's Core.Str for C++ interoperability.
The goal is to make C++ APIs that use std::string_view feel native and seamless when used from Carbon.
This mapping relies on the two types having an identical memory representation, a condition that we will work to ensure across all supported platforms.

@bricknerb bricknerb added proposal A proposal proposal draft Proposal in draft, not ready for review labels Oct 8, 2025
@bricknerb bricknerb force-pushed the proposal_string_view branch from ef2c6d2 to 45a9801 Compare October 8, 2025 09:39
@bricknerb bricknerb marked this pull request as ready for review October 8, 2025 11:37
@bricknerb bricknerb requested a review from a team as a code owner October 8, 2025 11:37
@bricknerb bricknerb requested review from chandlerc and removed request for a team October 8, 2025 11:37
@github-actions github-actions bot added proposal rfc Proposal with request-for-comment sent out and removed proposal draft Proposal in draft, not ready for review labels Oct 8, 2025
@bricknerb bricknerb changed the title Carbon <-> C++ Interop: std::string_view C++ Interop: Mapping std::string_view to Core.String Oct 8, 2025
@chandlerc
Copy link
Contributor

The only real concern I have here is with the name Core.String.

But the leads have resolved #5969 to give us a set of names now -- could you update the proposal to capture the decision and some of the rationale? Let me know if the rationale in the issue doesn't make sense and happy to help there.

@bricknerb bricknerb changed the title C++ Interop: Mapping std::string_view to Core.String C++ Interop: Mapping std::string_view to Core.Str Oct 20, 2025
@bricknerb
Copy link
Contributor Author

The only real concern I have here is with the name Core.String.

But the leads have resolved #5969 to give us a set of names now -- could you update the proposal to capture the decision and some of the rationale? Let me know if the rationale in the issue doesn't make sense and happy to help there.

Thanks Chandler!
Done.

Copy link
Contributor

@zygoloid zygoloid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, approving for leads.

@zygoloid zygoloid added this pull request to the merge queue Oct 20, 2025
Merged via the queue into carbon-language:trunk with commit c1c70d5 Oct 20, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proposal rfc Proposal with request-for-comment sent out proposal A proposal

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants