Re:First Impressions of Rust
by rkangel on Friday August 07, 2020 @06:13AM
(#24080316)
Requiring strings to be valid unicode simplifies the internal workings of (and use of) a language greatly. Dealing with unknown input becomes a single operation at the boundary after which you can safely assume everything is validly printable or processable as text.
[ Parent
| on HN ]
Re:First Impressions of Rust
by throwaway894345 on Saturday August 08, 2020 @12:37PM
(#24092960)
I think there is some convenience in being able to use the type system to denote input which has already been validated; however, I can't see how a language runtime benefits from this property with respect to unicode. Notable, printing and processing text aren't operations a runtime typically deals with. Libraries including the standard library might benefit from this property, but even then I wouldn't say the benefit is "great". It's a nice property, but I don't think it makes or breaks anything.
It's worth pointing out that Python 3 thought it important enough to make a backwards incompatible change to separate 'bytes' from 'strings' to effectively get the same result.
Re:First Impressions of Rust
by throwaway894345 on Saturday August 08, 2020 @03:21PM
(#24094327)
Probably, but I think that’s more to do with the typing convenience (which is even more puzzling in Python’s case since it isn’t statically typed).