News for hackers. Stuff that matters.
Re:The History and rationale of the Python 3 Unicode model f... by gumby on Thursday December 15, 2022 @12:11AM (#33995499)
Many systems used this convention; c was merely one of them. So it was a “choice” more than an”decision”.

The Mesa guys at PARC did a study back in the late 70s and, statistically, length-marked strings are faster than delimited ones.

Delimited strings have some advantages: they save the space needed to store the length, at the cost of an extra byte (not worth the cost these days); and some substrings can be assembled simply by pointing into the string (of course counted strings can share storage). But at a terrible cost.

But remember that the PDP-7 was less powerful than some AVRs. We use more powerful chips to scan keyboards these days.

Re:The History and rationale of the Python 3 Unicode model f... by adgjlsfhk1 on Thursday December 15, 2022 @11:40PM (#34010339)
You could pretty easily make it be very low overhead. Store the length of 128 or fewere byte strings with 1 byte for the length (starting with a zero), and if the first bit is a 1, then the string length takes 4 bytes (or use extra bytes with the same format).