logoalt Hacker News

viraptor • today at 12:25 PM • 1 reply • view on HN

There's another alternative - let most of the spec be derived from the code. Verus for example allows you to wrap your code in a verus!() macro and get a lot of the work for free and guaranteed to be in sync with the code. Even without any custom proofs, just that part provides a no-crash guarantee. (You still need to do some work though - it's not free)


Replies

AnimalMuppet • today at 3:46 PM

The normal pattern is that the spec is shorter than the code, and therefore easier to get correct. That's why it's useful. Deriving the spec from the code therefore seems like going the less-useful direction.