News for hackers. Stuff that matters.
Re:Rust 1.50 by pdimitar on Thursday February 11, 2021 @03:44PM (#26106877)
I'm looking at it through the lens of "let Rust have the best possible newcomer experience", which of course isn't a sentiment that has to be shared by the creators.

I suppose I appreciate SmallString's ability to alias itself to Rust's String.

But I'd immediately agree that this adds hidden complexity and the potential for it to bite you in the worst possible moment.

Re:Rust 1.50 by brundolf on Thursday February 11, 2021 @04:03PM (#26107133)
Going along with the other replies, I disagree that this would improve the experience for newcomers. SmallString is a hyper-optimization for specialized use-cases which (I would assume) is rarely worthwhile. I would actively discourage people from using SmallString without first profiling to identify Strings as their bottleneck, especially newcomers. String will almost always be "fast enough".
Re:Rust 1.50 by pdimitar on Thursday February 11, 2021 @04:41PM (#26107697)
Agreed that it's a very likely unneeded optimization. As shared in another sibling comment, I got frustrated with Rust's strings and figured that maybe one more complexity on top wouldn't be that bad. But thinking of it now, yeah, it's definitely a bad idea.
Re:Rust 1.50 by pornel on Thursday February 11, 2021 @03:55PM (#26107018)
I like that Rust's String is not trying to be smart. It makes it predictable and easy to reason about.

Because Rust has &str as the lowest common denominator for all string types, "non-standard" strings aren't difficult to use.

Re:Rust 1.50 by pdimitar on Thursday February 11, 2021 @04:40PM (#26107687)
I agree that less smartness is a good thing, it's just that sometimes I get a bit frustrated even with basic usages of Rust's String and &str. It gets easier with time but the first few months were a big struggle.
Re:Rust 1.50 by steveklabnik on Thursday February 11, 2021 @03:52PM (#26106986)
Even with that perspective, you can disagree. Offering even more string types may be more confusing for users.
Re:Rust 1.50 by pdimitar on Thursday February 11, 2021 @04:04PM (#26107158)
Yep. I was kind of thinking out loud but was curious about your perspective. Thank you.
Re:Rust 1.50 by steveklabnik on Thursday February 11, 2021 @04:23PM (#26107453)
Totally! That's how progress is made, thinking out loud :) Thank you too!