4 ms·
If you don't use `unsafe` then it guarantees it barring compiler mistakes. The compiler has had issues with memory safety before, they were found, and they were
by iopq 3y ago
If you don't use `unsafe` then it guarantees it barring compiler mistakes. The compiler has had issues with memory safety before, they were found, and they were fixed. There might be some left lurking, but they are extremely unlikely since people are using it in production and haven't seen anything weird.
If you use `unsafe` you have to make sure of it yourself, but you can easily grep for this keyword and see where the monsters lurk.
- c_crank 3y agoIf you use any language with garbage collection then you won't have memory safety problems (barring unusual corner cases). That is an actual guarantee of memory safety.
- ActorNightly 3y agoThe issue is that any Rust code is going to be targeted at performance processing (since otherwise you would write it in a higher level language). And for performance processing, you need to use unsafe (because at some point, the most efficient thing is getting or setting data at a certain memory address without anything extra). Look at any big Rust project, like Amazon Firecracker, and its littered with unsafes.
- iopq 3y agoYou really don't, I worked on a Rust project: https://github.com/ujh/iomrascalai https://github.com/ujh/iomrascalai it doesn't need unsafe code despite being performance-optimized