Can a formally verified C compiler be as fast as gcc?
CompCert’s optimizations come with a machine-checked proof that they don’t change your program’s semantics. The catch? The compiled code runs ~28% slower than gcc -O2.
We tried closing that gap with AI agents 🧵
I think my new rule is that if you say you formally verified some complex software and don't say anything about all the things you had to fix to make the proof go through, then I simply don't believe you
💭 unpopular opinion: type theories of Lean / Rocq are not complex and heavyweight enough. we need low-level, type-checked control over runtime *and* programs and proofs in the same lang
maybe dependently typed lang with OxCaml's modes. even better: graded modal dependent types!
Lean, Rocq, etc. seem very complex and heavyweight for many applications but they serve as least common denominators, and now that AI can write in type theories, why not? Still, it feels like a smell and I sense something different is around the corner, not sure what though
@DAgourakis I was replying to your earlier comment about units but I think I might have forgotten at the end. I think units can just be encoded with dependent types, I don't think we need a mode for that. +
@P33RL3SS yeah, I pointed it out because you seemed unhappy with my "mostly at places with virtually unlimited resources" claim, but it seems we actually agree.
we'll certainly see more assembly-level verification, but we should also ask why we see it mostly at places with virtually unlimited resources.
I don't think language semantics and program logics will die anytime soon, as they make program verification much, much cheaper.
I do not think this is the only answer, especially for scaling.
But it seemed to be the case with the Anthropic post and now DeepMind's about FV at assembly level for Signal.
@P33RL3SS when I say "assembly-level verification", I mean post hoc verification. verification of existing, arbitrary assembly code. that doesn't seem to be what you're doing in your paper.
@P33RL3SS I'm not talking about synthesis. (one could argue a compiler also does machine-code synthesis!)
in synthesis, you can stick to a subset (or a set of patterns) that plays nicely your proofs, which lessens the need to "brute force" verification.
@flimflamlite HOL doesn't give me the control I want over the runtime. maybe we'll be able to develop sufficiently clever compilers so that I won't need the low-level control, but that hasn't been the case so far, which is why we still have people writing C, C++, Rust, etc.
@sonatsuer for writing performant programs. we already know nested inductive types (and inductive types in general) are a potential source of bugs. (see https://t.co/rsLj5Z1Zjg) what I want isn't something that as powerful as inductive types, it's a way to constrain existing programs more.