Re:Ali Cehreli Introduces Dlang at Northeastern U
by WalterBright on Wednesday October 12, 2022 @01:40PM
(#33180372)
I don't see the difference here. D offers the same options when processing a string.
[ Parent
| on HN ]
Re:Ali Cehreli Introduces Dlang at Northeastern U
by wtetzner on Wednesday October 12, 2022 @06:17PM
(#33184373)
I think the point is that you run the unicode validation once on your [u8] array, which gives you a &str (or String for the lossy variants). From then on, you know you have valid unicode and don't need to keep checking.
Re:Ali Cehreli Introduces Dlang at Northeastern U
by tialaramex on Wednesday October 12, 2022 @06:31PM
(#33184566)
That's surely the whole point, every D std.string function is also a string decoder with varying features. But a suitably decoded "string" is still just the same type, whereas Rust has a distinct type for actual UTF8 strings