3 ms·
Slightly ironic that Rust is criticized for having multiple string types, and yet the solution to simplify string handling in C is to introduce the exact same t
by Diggsey 4y ago
Slightly ironic that Rust is criticized for having multiple string types, and yet the solution to simplify string handling in C is to introduce the exact same types (str_t == &str, strbuf_t == String) albeit without the safety guarantees.
- estebank 4y agoIt is still frustrating to me that C still doesn't have a non-allocating method to handle substring references, which both C++ and Rust have. On the other hand I see people trying to parse files, like JSON, in a non-allocating way in Rust and hit a wall until they realize that nodes need to be escaped for anything useful, which requires owning the node's memory (meaning, you need a String or at least Cow<'_, str>, can't get away with a &str).
- adamdusty 4y agoI don't think anyone minds that rust has multiple string types just that they're effectively named the same thing so people new to rust have no clue which does what without looking it up. Furthermore people without c/c++ experience mostly wont even know there is a difference since most languages don't give you that control over strings. If rust string were str and strvec or strbuf no one would care.