-
Notifications
You must be signed in to change notification settings - Fork 76
Improvements for ABI Compatible Data Types feature request #1997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvements for ABI Compatible Data Types feature request #1997
Conversation
C++ forbids zero-sized types, so any type is at least 1 byte in size. This is incompatible with Rust, where empty structs etc. really have a size of 0.
|
|
|
The created documentation from the pull request is available at: docu-html |
7fb1fe6 to
a865ba7
Compare
|
This PR is stale because it has been open for 30 days with no activity. It will be closed in 10 days if no further activity occurs. #magic___^_^___line |
|
@FScholPer @antonkri @johannes-esr @qor-lb Could either of you review and merge this PR? It would be unfortunate if these improvements got lost. |
| Strings | ||
| """"""" | ||
|
|
||
| Strings have the same memory layout as ``AbiVec<u8>``, but additionally guarantee that their content is valid UTF-8. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wondering how we're going to guarantee UTF-8 validity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UTF-8 validity of str is automatically guaranteed in Rust. In C++, custom wrapper types for UTF-8 strings would enforce validity, in the same way as the generated types for tagged unions would enforce valid memory patterns.
This PR makes some modifications to the ABI Compatible Data Types, as discussed during the Architecture Community F2F Workshop on 2025-11-05. Primarily, these are: