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

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

338 points by todsacerdoti 1 day ago | blainehansen.me | 311 comments on HN

View full thread · View on Hacker News

Comment thread (6)

  1. If Haskell would finally give up on the disaster that is laziness (and by extension GHC) and pivot to formal verification, this could be the killer app.

    Much of what the author wants already exists!

    Replies (3)
    1. The issue with Haskell and other functional programming languages is that it doesn't reflect the hardware paradigm. Reasoning within a functional programming language is obviously simplified due to the statelessness, however you lose the benefits of memory hierarchies and other hardware improvements we have due to spatial and temporal locality. You might be able to fix this with a smart compiler, but then reasoning about the correctness will be another challenge.

      If a language cannot balance tradeoffs between hardware and software, people will still use the most performant language, especially for resource-intensive tasks, so you end up with what we currently have. We need to rethink how we can design a language that is token-efficient, offers memory safety, is close to the metal, and lastly implements formal verification guarantees. The closest what we have to this is Rust and C++, but it's not good enough.

      Replies (2)
      1. > however you lose the benefits of memory hierarchies and other hardware improvements we have due to spatial and temporal locality.

        This is ironic considering the default GC strategy for GHC's RTS is a copying collector that puts values physically close if they are used together plus bump allocation. That has good cache side effects (heh).

      2. Linear type solve a lot of this problem. Idris2 have https://github.com/stefan-hoeck/idris2-ref1 which has been proved to be efficient
    2. The haskell community has practically settled on StrictData for years now... Alexis King gave the final blow on. Old complains never die though.
    3. At that point why not just use Lean instead of Haskell? It has opt-in laziness with thunks which is arguably the better approach