Python-like string in Rust

I think UTF-8 is not the worst choice. Indexing codepoints doesn't fix all potential problems either, as shown in this post.

That said, I feel all options have drawbacks when Unicode is involved.

3 Likes

The biggest problem with Unicode is simply the fact that char-level access to a string is almost entirely useless yet it's hard to explain to layman who only knows about his own language and maybe about Greek or Russian.

You can not use that access that Python tries to provide for any reliable code, but script-using people rarely want that, rather they want to write some small script for themselves which works in some very narrow case.

And then, of course, that thing grows and becomes a problem, eventually… but Rust approach “if you know that road leads to a dead end then maybe better to just pick another road” doesn't work because people just don't expect the whole travel on that road.

1 Like

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.