Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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++.


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.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: