logoalt Hacker News

Proof-oriented programming in Verus vs. Lean

37 points • by fanf2 • last Thursday at 9:42 AM • 10 comments • view on HN

Comments

tkz1312 • today at 1:17 AM

I've found that I tend to move a lot faster in lean than verus. I think the proof and tactic language are just a lot more expressive and rust compile times are just generally very painful. I also just find lean to be a much more expressive, pleasant, and readable language than rust. You can also get to a much smaller tcb with lean than with verus.

It does take more work to get to a really fast system with fully manual memory management in lean, but once you do it will have much better trust assumptions than the versus solution.

t520z520 • yesterday at 11:29 PM

SMT solvers—which Verus builds upon—feel like a pre-AI workaround for the scarcity of human proof labor. By analogy to Turing completeness, interactive theorem proving is 'complete' in a way that wrestling with a heuristic-driven solver never is.

➕ show 1 reply
rramadass • today at 12:19 AM

SAT/SMT solvers are easier to understand for programmers than type-based interactive theorem provers. Their FOL maps cleanly to state transitions in a program thus allowing you to map them to VCs which can then be solved.

IMO one needs to study both automated solver-based verification and type system tactic-based interactive theorem provers.

While Lean (dependent type system based) is getting all the attention because of mathematicians, programmers are better served starting with understanding solvers i.e. by using pre/post/invariants/asserts etc. in code. A good book to study is The Calculus of Computation : Decision Procedures with Applications to Verification by Aaron Bradley and Zohar Manna.