logoalt Hacker News

wongarsu • today at 12:24 PM • 3 replies • view on HN

There is a formally proven compiler for a large subset of C, so I don't see why formalizing (a large subset of) rust and making a formally proven compiler shouldn't be possible


Replies

afdbcreid • today at 12:53 PM

There is a severe misunderstanding here. Beside being only a subset, CompCert definitely has UB. It just formalizes codegen for codebases not containing UB, which obviously won't be enough for Rust.

afdbcreid • today at 12:56 PM

Also unlike C, it should be possible to formalize all of Rust, not just a subset. For two reasons: Rust evolution (not initially but today) is strongly tied with formalizing it and the language team consults with formalization experts (which are part of the Rust project themselves) all the time (and formalization or semi-formalization projects are ongoing), and also the mathematical understanding of system languages itself has advanced.

➕ show 1 reply
UncleMeat • today at 12:30 PM

Because people want a performant optimizing compiler.