Unofficial Hacker News companion — get notified on comment replies, and more.

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

344 points by todsacerdoti 4 days ago | blainehansen.me | 325 comments on HN | Vote on HN (opens Hacker News) |

View full thread · View on Hacker News

Comment thread (1)

  1. I'm not sure that is the way to go. Languages with advanced type systems such as Lean, not only allow you to check properties of code, they also make certain errors impossible by construction. For instance if you encode natural numbers as Zero or Succ n then you don't have to check whether the number is negative, it is just impossible by construction. The more your data types encode properties themselves the less you even have to prove properties using theorems and proofs as the data is itself the proof in a way. Off course, some properties cannot be encoded in this way, or it is more confortable to just use more general data types together with proofs, for instance using an integer and a proof of n >= 0.

    If it really is the case that programmers will no longer program, then it might become irrelevant which language they use, in which case it might be the case that LLMs will be more efficient in doing formal verification using data types that encode the properties you want, and that requires languages such that have more advanced type systems than mainstream languages.

    I imagine that it is a lot more work to do formal verification on assembly or machine code ? On the hand I believe that is what was done for signal recently...