Post #2544942
2026-05-13 18:48 UTC
After spending a grip of time surveying all of the mutable and immutable string type situations (and trainwrecks) in other languages back in 2024, I have found myself just revisiting it all again.
I was planning on `str` being a special-cased type that treated as a value but this essentially leads to built-in accessor functions like `len()` and `bytes()` that have special visibility access into the internal struct...which is _ok_ but...
Replies (2)
-
@cda@macaw.social 2026-05-13 18:51
The more I thought about that this morning, the less I liked it compared to just exposing the internal struct fields like `a_string_var.len` and `a_string_var.bytes` and just special casing field access and pass-by-value in the compiler. No special sauce pseudo-functions.
-
@cda@macaw.social 2026-05-13 19:33
@lritter@mastodon.gamedev.place are all strings in Scopes GrowingStrings that are "managed" on the heap?