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

> This is also false. If you get memory unsafety outside of an `unsafe` block, it is a by definition a bug in the compiler.

All `unsafe` memory access in Rust performed in separate address space? I'm asking because if it isn't - this can't be called `isolated`.



Ah, I thought we were talking about isolation for code auditing purposes. If you're concerned about address space isolation, then this other statement is false:

  > If somebody needs memory safety - managed languages with 
  > GC is the only real option
If I'm in Java, I can call C code via JNI that does whatever garbage I want with the memory of the Java program. There's no isolation there; we are thwarted by the need for FFI. Likewise, `unsafe` in Rust is just a reified FFI: it allows you to do things that Rust doesn't allow you to do, but, crucially, `unsafe` blocks in Rust are still much safer than the C code that you'd otherwise be writing. Thus `unsafe` is a mechanism for making Rust programs safer than they otherwise would be, by avoiding the need to call into C.




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

Search: