‹ BackHN Continuity

Thread

Developing provably correct Rust code with Verus

164 points · 79 comments · Betelbuddy

  1. reddit_clone · · focus · HN ↗
    This is very interesting.

    I am new to Rust and also new to formal verification.

    Can someone ELI5 this for me?

    (Also, when does the proof happen? During compilation or by running extra tests during unit testing?)

    1. Jtsummers · · focus · HN ↗
      Proof happens before compilation, and doesn't require compilation. You can follow the Verus tutorials for the specifics, but you can use it as a standalone verifier or as a compilation "stage" where it'll run its verification and then conditionally continue on to compilation.

      Their tutorial seems ok: <a href="https:&#x2F;&#x2F;verus-lang.github.io&#x2F;verus&#x2F;guide&#x2F;overview.html" rel="nofollow">https:&#x2F;&#x2F;verus-lang.github.io&#x2F;verus&#x2F;guide&#x2F;overview.html

      But if you want a more complete tutorial on this concept using similar tools (so what you learn from them will transfer well to Verus, even if you need to learn Verus or Rust specific details) check out Dafny or SPARK&#x2F;Ada. The latter is mature and used in some parts of the software industry today. The former, I don&#x27;t know if anyone actually uses it in production though theoretically you can (it generates code in several languages, I have not used it for that myself, just in an instructional capacity).

Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.