3 ms·
The second you have any `unsafe`, Rust is _by definition_ not memory-safe.
by Graziano_M 1y ago
The second you have any `unsafe`, Rust is _by definition_ not memory-safe.
- Ar-Curunir 1y agoBy that definition, Python is not memory-safe, Java is not memory-safe, Go is not memory-safe, and so on. All of these languages contain escape hatches to do memory-unsafe stuff, yet no one is calling them memory unsafe.
- ummonk 1y agoGo is more memory unsafe than Java or Rust. Data races in concurrent Go code can cause memory corruption, unlike in concurrent Java code. Safe Rust is designed to avoid data races altogether using static analysis.
- Meneth 1y agoAnd the majority of the Rust standard library uses `unsafe`.
- Measter 1y agoProve it. Show me the stats that the standard library is over 50% unsafe.
- 9rx 1y ago"Over 50%" only holds if the statement is intended to be binary. It may be that he considers direct use, no use, and transitive use to be all different. In which case it is possible that the majority[1] use unsafe, even if more than 50% does not. [1] The cult of the orange man would call this a plurality, which may be what has tripped you up, but the civilized world calls it a majority.