News for hackers. Stuff that matters.
Re:My personal C coding style as of late 2023 by mikewarot on Monday October 09, 2023 @02:06AM (#37817365)
>Pascal strings? Yeah, that’s probably the better call, but why not use C++ or Rust or something where a bunch of geniuses got it right already?

I'll be diving into C fairly heavy for the first time ever next year. I intend to skip right past pascal strings and implement/use free pascal's AnsiString or UnicodeString, both of which are reference counted, have a length (with no limit) and are guaranteed null terminated. I've stored a gigabyte in them in a few milliseconds. There's no need to allocate or free memory either... it's like freaking magic.

Re:My personal C coding style as of late 2023 by mhd on Monday October 09, 2023 @11:33AM (#37821483)
Haven't seen that many refcounted string libraries for C in recent times, most common one is probably still the one from glib.

I guess you're going to implement your from scratch, or is there some prior art you're likely to use?

Re:My personal C coding style as of late 2023 by mikewarot on Monday October 09, 2023 @11:53AM (#37821699)
If at all possible, I'll just lift the one from Free Pascal. Otherwise, it's yet another chore in the process of bringing MStoical (a modern port of the STOIC language) to life