An unofficial, read-only Hacker News reader. Join the beta →

The need for a formally verifiable mainstream programming language (opens external site)

301 points by todsacerdoti 17 hours ago | blainehansen.me | 296 comments on HN

View full thread · View on Hacker News

Comment thread (7)

  1. Formal verification is not a silver bullet! I am afraid AI has positioned it as the ultimate red herring (and nerd-snipe).

    I recommend reading Cantwell Smith's "The Limits of Correctness" https://dl.acm.org/doi/pdf/10.1145/379486.379512

    The TL;DR is that proofs only show that the program matches a spec, not that the spec matches the world. The gap between "what you can model" and "the real world" is generally too large for formal methods to be useful (outside of narrow domains, where they are highly useful).

    In other words, computing is closer to an empirical science than a formal one.

    Replies (6)
    1. "If civil engineers built bridges like how software engineers write software there would be no bridges left today"
    2. Proofs are programs themselves. So if you generate the very program from your proof (like with lean), that mismatch should not really happen.

      Of course you may have still written incorrect spec, and once you have IO you probably won't model the whole Linux kernel in the proof.

    3. You can say the same about tests, yet they're useful and everybody is using them.
    4. The program matching the spec matters a great deal for security purposes. If we achieve nothing other than that, we’re in a much better position than we are today with C and PHP.
    5. The gap between the spec and the world is a minor technicality that will be solved in 1 month, max. You can quote me.
    6. Yeah, it's very possible that mainstream formal verification will look more like a test case that takes arbitrary input and asserts over how that input behaves.

      That won't cover all behavior, but it's more thorough than fuzzing, and even more than unit testing.

      But yes: it'll just be another tool in the toolbox.