top | item 32908798

(no title)

petmon | 3 years ago

It's common in other programming languages for string literals to have type string. It's weird and confusing that they do not in both Rust and in C++.

discuss

order

baq|3 years ago

It might be acceptable in higher level languages where some things will simply break in corner cases, at which point the developer will just say 'don't do that' and all is fine. If you're aiming at a true low-level bare-metal-capable syscall-winapi-native-speaker language, this is not an option.

ModernMech|3 years ago

It’s weird and confusing, but also performant. Remember Rust is first and foremost a systems language. You can get a 10x speed boost by using the right string (str vs string) in certain circumstances.