News for hackers. Stuff that matters.
Re:String tokenization in C by paavoova on Saturday December 15, 2018 @12:01PM (#18689157)
> but you'll be incompatible with any code dealing with native C-strings

Not entirely, see https://github.com/antirez/sds

Basically, you have a header storing length, etc, but still null terminate, so library functions like strlen are none the wiser.

Re:String tokenization in C by saagarjha on Saturday December 15, 2018 @01:09PM (#18689532)
You lose the ability to pass create zero-cost slices, though. C++11 actually implements strings like this, but iterators allow you to pass in parts of the string as necessary.
Re:String tokenization in C by the_duke on Saturday December 15, 2018 @12:10PM (#18689204)
Nim (the programming language) implements strings this way, AFAIK, with the same reason: to be easily compatible with the C ecosystem.