Wild thought, what if we wanted to get rid of string slices. Lets ignore backward compatibility in this thread. I still don’t get why String and String slices have to be separate and I’m getting tired of explaining the difference to my colleagues. To me that’s a huge ergonomy issue in the language which is not only confusing new rustaceans but also annoys me as an experienced developer because i constantly have to convert from one to the other.
String slices are different from string mostly due to where they are stored, but I am questionning whether that could have been abstracted over. Java for example, even if the problem is different there, also has two types of string, and the string slices in Rust is similar to the String pool of java, except that Java makes it almost transparent. Haskell on its side has the overloaded string extension.
From my developer perspective a string slice and a String reference are the same. The fact that they are stored diffently and its performance implications is not something I want to have to think about. (I want zero cost abstraction here!)
Forgetting backward compatibility, is there anything preventing that?