core: add fixed String<N> primitives#1437
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1f1cee5800
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
fefec1d to
844b6c5
Compare
String<N> primitives
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 844b6c5e54
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Add core String<N> utilities for fixed-width byte round-trips, effective length, concatenation, and equality. Keep CTFE and runtime casts consistent for fixed strings, add runtime/CTFE coverage, and include the release note for PR argotorg#1437.
Add core String<N> utilities for fixed-width byte round-trips, effective length, concatenation, and equality. Keep CTFE and runtime casts consistent for fixed strings, add runtime/CTFE coverage, and include the release note for PR argotorg#1437.
Add core String<N> utilities for fixed-width byte round-trips, effective length, concatenation, and equality. Keep CTFE and runtime casts consistent for fixed strings, add runtime/CTFE coverage, and include the release note for PR argotorg#1437.
Add core String<N> utilities for fixed-width byte round-trips, effective length, concatenation, and equality. Keep CTFE and runtime casts consistent for fixed strings, add runtime/CTFE coverage, and include the release note for PR argotorg#1437.
There was a problem hiding this comment.
This seems to be a significant finding:
/tmp/fe-pr-1437.ntvyMt/ingots/core/src/string.fe:12: String::as_bytes() exposes intrinsic::__as_bytes as a runtime-usable public method, but that intrinsic currently appears to have CTFE support only. A
real runtime path with a String parameter fails codegen with invalid runtime package: InvalidReturnClass. Since len() and concat() both call as_bytes(), this breaks the advertised runtime utilities for
non-constant values. Minimal repro I used:
fn fifth_byte(s: String<8>) -> u8 {
let bytes: [u8; 8] = s.as_bytes()
bytes[4]
}
Running fe test on that helper failed in Sonatina emission before tests ran. The existing fixture passes because it only exercises literals/local constants, not a true runtime String input. This needs
runtime lowering for __as_bytes or an implementation based on runtime-supported word operations, plus a fixture with a String parameter/storage value.
| @@ -6,7 +6,8 @@ use salsa::Update; | |||
| use super::{ | |||
There was a problem hiding this comment.
Might be worth to ask the agent to separate these changes into its own commit just to keep the history a bit cleaner.
Yeah, that intrinsic was added to make |
Added core
String<N>utilities for fixed-width byte round-trips, effective byte length, concatenation, and equality in const and runtime code.closes #1435