News for hackers. Stuff that matters.
Re:Formal Mechanised Semantics of CHERI C: Capabilities, Und... by nextaccountic on Thursday April 18, 2024 @10:18PM (#40082850)
No. CHERI doesn't help with data races, for example. Also it doesn't help with compiler optimizations that exploit UB to make code faster.

Unfortunately low level languages are kind of addicted to optimizations that only work for languages with UB. There's too much performance being left at the table if you create a programming language entirely without UB.

There's no law of nature, however, that says this must be the case forever. You could have a theorem prover prove useful properties about programs (and them feed them to the optimizer) and refrain from "optimizing" if you can't 100% prove that this will not break.

Re:Formal Mechanised Semantics of CHERI C: Capabilities, Und... by touisteur on Friday April 19, 2024 @07:15AM (#40085367)
This is one actual use of SPARK for me. Prove the absence of runtime errors (and if necessary add preconditions) then let the compile optimize to hell.

Another example on tweetnacl: https://blog.adacore.com/sparknacl-two-years-of-optimizing-c...