An unofficial, read-only Hacker News reader.

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

343 points by todsacerdoti 2 days ago | blainehansen.me | 320 comments on HN

View full thread · View on Hacker News

Comment thread (9)

  1. We do not need a full-on theorem prover for achieving this.

    Something like ZFC axioms is good enough. External formal verification tools are not ideal either. Its better if the type system of the host language's got these essentials included, like having a model checker for its abstract machine or something. However, model checker for enforcing correctness(especially of the intent) will be much harder to implement in languages without a well defined, stable ABI and type system, which typically is the case with almost all mainstream languages. Even though operational semantics is the semantics of the hardware, most languages do not strictly adhere to it due to a lot of practical reasons.

    Mainstream languages that become practical enough to be used by masses will usually be in a spot where it becomes very hard to formally define the language and when that happens, enforcing "correctness" becomes close to impossible. Stuff like this needs to be addressed since the start.

    Selling to the entire industry the idea that "memory safety" is the only thing essential security requirement, while all else is a low priority, simply means that anyone who bought that ad either had surplus resources or was operating with inadequate requirements to justify doing so. Computer programming is about deductive reasoning of the programs and that means its much more than just writing code and handling resources properly.

    Replies (3)
    1. this doesnt even make sense.... what do you mean
      Replies (1)
      1. I updated my reply to be more explicit.
    2. > Something like ZFC axioms is good enough.

        Axiom of Infinity - There exists an infinite set.
      
        Axiom of Replacement - If a function is defined, then for any set, there exists a set of images under that function.
      
      Why would these help me?
      Replies (1)
      1. Noice nitpick!

        Take what you need and leave what you don't, however you see fit for your requirement(s). One might not need all of the axioms.

        Replies (1)
        1. Since you called me out for nitpicking, go ahead and read the ZFC axioms as charitably as you like, and explain how they would be all you need to formally prove your code.
          Replies (1)
          1. By "Something like ZFC axoims is good enough", I did not mean the entirety of ZFC to the brim.
    3. I agree with most of your comment but I'm not sure what you mean by "ZFC is enough"
      Replies (1)
      1. "Something like ZFC axioms is good enough".

        And by that I do not mean the exact, whole theory of ZFC itself but a trimmed down or a bloated version instead. The point is to have the appropriate and intuitive axiomatic semantics that cover the core constructs of the language, at least.