News for hackers. Stuff that matters.
Re:Rust 1.17 by dronemallone on Thursday April 27, 2017 @11:30PM (#14216695)
So isn't the memory model more to do with the compiler or operating system rather than the programming language? Do think it's possible to write a C compiler that checks for use after free, double free, buffer overflows, index out-of-bound issues, etc.?

Surely if one programming language can do it, another can?

Re:Rust 1.17 by Manishearth on Friday April 28, 2017 @03:22AM (#14217507)
A C compiler that checks for all of these things at runtime is Valgrind. It's used when testing.

A C compiler that checks all of these things at compile time would no longer be a C compiler.

Compile time guarantees require you to change the language and restrict what is allowed to compile. Rust does just that, it's a different language. You could write an extension to C like Cyclone (or the ISOCPPCore guidelines for C++) that make it safer via compile time checks. You would likely need more annotations and most existing C programs would no longer compile.

(There is the ergonomic benefit of being able to transition from a C codebase to a, say, Cyclone one, though)

Re:Rust 1.17 by Others on Friday April 28, 2017 @01:40AM (#14217085)
It's not possible to write a C compiler that guarantees what Rust guarantees. There are just too many implicit assumptions about pointers. Even if you check most cases, weird stuff like XOR linked lists will trip you up. (And sure, if you changed the language you could make it safe -- but then it wouldn't be C anymore.)
Re:Rust 1.17 by pjmlp on Friday April 28, 2017 @02:59AM (#14217404)
> Do think it's possible to write a C compiler that checks for use after free, double free, buffer overflows, index out-of-bound issues, etc.?

No, due to the way the language semantics works.

There are static analyzers that do something like that, MISRA-C, High Integrity C, Frama-C, but you are literally using C with Ada semantics at that point, thus it is almost like another language.

Re:Rust 1.17 by bluejekyll on Thursday April 27, 2017 @11:57PM (#14216779)
Of course, and many programming languages offer similar features as Rust. I've not used Ada myself, but people claim it offers similar safety features.

From my experience though, Rust is the first language that I've had the pleasure to use which offers both the safety guarantees of Java (and more, no data races!) and the low level features of C.

It still leaves me in awe what has been accomplished with Rust, and I've been using it for more than two years now.

Re:Rust 1.17 by openasocket on Friday April 28, 2017 @09:12AM (#14219061)
For arbitrary C code, I believe checking for those issues is equivalent to the halting problem. Or at least uncomputable.