thephd, 👀 String buffer type in C...?
https://open-std.org/jtc1/sc22/wg14/www/docs/n3250.pdf (It's a long paper. You can skip the rationale bits if your brain has been turned on for the last 2 decades and you don't need your hand held through why this is a Good Idea In General, but reading it is still enlightening!)
This paper is not how I would do it, but that's because I want 2 things:
- some of what is contained in this paper, for exactly what is described in this paper
- some of what is contained in this paper, but with no alloc/ownership (manipulation of substrings, etc.)
Before I want to even tackle this question, though, I need to have a language-based span in C (Walter Bright's
char meow[..];
stuff) so we can just work with memory slices like normal people and not like insane jerks. So I probably will be neutral/abstain when voting on this, even if I kind of like it. I think it's API would be far stronger if we had slices in the language first. Of course, I don't want to be all "you can't make improvements until I make MY improvements, first!!" on the proposal...!