Unofficial Hacker News client - receive Push Notifications on replies.

So you want to build a mainstream formally verifiable language (opens external site)

117 points by mpweiher 1 day ago | danilafe.com | 80 comments on HN | Vote on HN (opens Hacker News)

View full thread · View on Hacker News

Comment thread (10)

  1. Lean has already gone mainstream.
    Replies (2)
    1. It's not a bad choice! But I am yet to see any "real world software" written in it, in public or in private.
      Replies (3)
      1. I wrote tic tac toe for the terminal in it :)
        Replies (1)
        1. I stand corrected :)
      2. It definitely isn't bad choice, it reads a lot like Haskell. I've been exploring this myself too, haven't tried performance, but there are some Postgres / HTTP libraries for it.

        Its macro capabilities make it very nice for SQL driven apps. I've been working one small invocing schema, and you can derive the Insert, Patch etc types with just macros with `deriving Patch` at the end of your type.

        Also, one of my reasoning is that if these AI LLMs are tuned to work with millions of lines of Lean, it probably is very efficient for it.

      3. I'm very focused on the "real world software" use case for Lean. Right now it's pretty thin but Nick Palladinos has done some great work IMO

        https://github.com/palladin/lean-linq https://github.com/palladin/lean-cloud

    2. Why did Lean win over Rocq/Coq? It was popular first, then Lean overtook it.
      Replies (3)
      1. A more polished/user friendly design, and more suitable to formalizing math (built in quotients support). Also more efficient/faster.
      2. IME Rocq has more legacy quirks. For example, proof automation is done in LTac (very not composable and “spaghetti” but more support and documentation) and LTac2 (newer, confusing, still hard to compose). Inconsistent syntax and behavior, tactics unexpectedly failing (because they’re spaghetti). And maybe this was my poor skill, but even simple tasks were slow, just finding the right lemma, tactic, or syntax to apply them.

        Lean:Rust::Rocq:C++

      3. Lean is a real programming language with the power and expressiveness you'd expect from that whereas Coq functions more like a theorem prover with an escape hatch

        As a result of that and other choices Lean also felt more natural and ergonomic to mathematicians than Coq. And the early Lean community did a very good job at using this to build Mathlib which coalesced into a comprehensive library for reusable proofs and math concepts which compounded and built upon itself with standardized conventions

        In contrast much of the Coq ecosystem's output has increasingly fragmented rather then accreting like Lean's has

        It also helps that Lean is uniformly 1-2 orders of magnitude faster than Coq, partially because it compiles to C