News for hackers. Stuff that matters.
Re:Frama-C is a suite of tools dedicated to the analysis of ... by nullc on Saturday April 12, 2014 @04:10PM (#7579012)
Right, the borrow checker does great things. But memory safety is only one aspect of program correctness— though a universal and very important one.

If a program does anything important, if it handles secrets, if it enforces invariants ("the robots arm must not be out of the safe area"), etc. then other aspects of the programs logic may be just as safety critical as memory safety. Frama-C can prove other things about program saftey: this calculation cannot overflow, this error state can never be reached, this operation will complete within X steps... even if the results of non-safety don't result in anything to do with memory errors.

Some of the programmers expectations can be extracted from the program— signed integers won't overflow, loops (unless otherwise annotated) will always terminate, pointers will not be extended outside of their objects, a pointer to an integer won't be called as a function pointer, behavior will not depend on the order function arguments are evaluated in, etc. Some of the expectations must be expressed as assertions.

Once as many of the programmers expectations are understood the analysis needs to know the invariants that allow them to be true. Some of these can be extracted, some must be asserted.

The gap that exists today is that a lot that could be extracted (e.g. by another programmer reading in a context free way, with high probability of success) can't be soundly extracted because there is a lot of technically valid behavior which is just usually unlikely to be what anyone intended. This means that anyone attempting to apply tools like frama-c has to spend a lot of time making the implicit assumptions explicit with assertions. Thats why I was saying that something like making singed overflow defined may be a step backwards because it takes a whole class of "you couldn't possibly have intended this behavior" back to "maybe you meant this".

Re:Frama-C is a suite of tools dedicated to the analysis of ... by pcwalton on Saturday April 12, 2014 @04:38PM (#7579102)
Sure, I totally agree that there are many other invariants that you might like to prove. Many of them require full-on dependent typing—not going there for now is a choice we made to make the language approachable. (See your sibling comment for how difficult it is just to get memory safety!) But I completely agree with you that there is more to be done.