News for hackers. Stuff that matters.
Re:Rust, Lifetimes, and Collections by Animats on Wednesday November 19, 2014 @06:56PM (#8633559)
Calling external code is a separate issue. This is about unsafe code within the language.
Re:Rust, Lifetimes, and Collections by dbaupp on Wednesday November 19, 2014 @07:16PM (#8633638)
I thought it was about buffer overflows and security vulnerabilities within Rust programs? i.e. not just the parts written directly in Rust. Looking at anything else seems a bit silly, since the thing that runs in the real world is the whole program.

The low-level code has to exist somewhere, vectors need to be allocated, strings need to be printed, and people will want the performance. This code is either going to be in external libs called via FFI, as raw codegen in the compiler or in Rust. The last sounds like the one that is safest since the FFI code would have to be written in one of the unsafe systems languages, while writing in Rust gives all the type system advantages and high-level features (references, pattern matching), not to mention avoiding the (mental) overhead of correctly interacting between languages.

It seems to me that taking away the low-level power of opt-in `unsafe` is just myopically punting the problem along, rather than seeing it as giving Rust the ability to avoid having to write really unsafe C plugins (like Python etc.).

Re:Rust, Lifetimes, and Collections by kibwen on Wednesday November 19, 2014 @07:19PM (#8633645)
But they aren't separate issues. If you couldn't do these things in Rust, people would just drop into C to do them. Given that that would introduce much more unsafety into Rust programs, Rust does the right thing by reifying unsafe memory operations and sequestering them away.