An unofficial, read-only Hacker News reader.

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

343 points by todsacerdoti 3 days ago | blainehansen.me | 321 comments on HN

View full thread · View on Hacker News

Comment thread (20)

  1. Reminds me of pure functional languages. Sounds so nice, no icky state or side effects. Doesn't actually help for real problems.
    Replies (5)
    1. How on earth they not help with real problems? Also, their very point is that most of the program is pure, but they most definitely have IO and other kind of side effects, it just lives at the very edge of the system.

      Haskell has interesting uses in industry, but in general in the last decade or so the functional paradigm has become retrofitted to basically each mainstream language. Like java's streams/lambdas, algebraic data types in basically every modern language (rust), immutable by default, etc.

      Replies (1)
      1. You've got to remember that the average developer is a Javascript or Python coder who lacks the mathematical ability to do even the most rudimentary abstract alegbra, and so cannot write or understand a production Haskell program, let alone understand how abstractions can eliminate whole classes of bugs.
        Replies (4)
        1. Who is credentializing these devs, hiring them, and how are they getting by?
          Replies (3)
          1. AI has made them into 10x devs now. 10x the output, of putting together simple solutions to known problems with a few components. Basically following a recipy, like a suit is customized for each customer.
          2. It's a simple majority issue.

            If the majority say "you don't need a degree" then you don't need a degree.

            If the majority believes in "move fast and break things" then things stay broken.

          3. College degree, coding boot camp, or no formal credentials but they built side projects to show to potential employers. Also there was an extreme demand for software devs at certain points in time pre AI coding, where they just needed people to write basic stuff in whatever framework.
        2. Java has sum and product types with exhaustive pattern matching, lambdas and streams, and is the next more widespread language just after python and js.

          JS devs are doing monadic development (async is just that), and plenty of lambda passings, with the predominant frontend framework model being one where the view is a pure function of state, driven by reactive changes of the state.

          Functional won vast areas in mainstream programming. What you are saying may have been true 15 years ago, but not anymore.

          Replies (1)
          1. Yes, what prevailed is doing a reasonable mix of paradigms instead of going all-in on something. Pure functional was never popular, but pure OOP was, and it sucked.
        3. This is the problem that excites me the most about agentic coding

          I think software development and the tools underlying it could be wildly more powerful and exploit the underlying computer algebra more directly if dev tools didn't have to cater to the lowest common denominator imperative language dev

          LLMs are valuable to me not because they can replace the types of coding these devs do, but because they have a far more deeper 'understanding' of the foundational math and algebra than could ever be expected of the average dev

          There's ways software engineering could engage much more directly with these concepts to produce more sound and expressive results if the "user" could be safely assumed to be an IMO level mathematician like a sufficiently powerful LLM is

          Replies (1)
          1. > LLMs are valuable to me not because they can replace the types of coding these devs do, but because they have a far more deeper 'understanding' of the foundational math and algebra than could ever be expected of the average dev

            This is the correct way to look at using LLMs for coding using their "jagged intelligence". The key here is that the developer has to know enough of the formal methods mathematics to guide the LLM within proper guardrails such that it cuts down on the non-determinism. You don't have to be a master mathematician who knows every single detail but just have enough conceptual understanding of the domain that you can create modular components and link them together using pre/post/invariants/assertions and type-driven design. You keep overall control while leaving the drudgery to the LLM.

            Here is one process methodology that i wrote up - https://news.ycombinator.com/item?id=50319347

            Replies (1)
            1. I like your post, it's interesting that it centered on UML which is similar in shape to some formal concepts modelled in Lean: particularly Arrows, Quivers, String Diagrams and Petri Nets
        4. I'm not the average developer. And by the way, I've heard that rant before, always from that one SWE on the team who's going to be the hardest person to work with by focusing on all the wrong tiny details.
    2. Tell me about a real problem you have.
      Replies (1)
      1. My job had me working on a custom version of ejabberd across like 2 years. For those unfamiliar, that's in Erlang, which is probably one of the more convenient to use pure functional languages. It worked, but it was so cumbersome. BEAM is cool though, so they made Elixir to use that without sticking to pure functional.

        Or like, make any web backend.

    3. So none of the problems Nix solves are "real"?

      Do you really think all the math proofs being done with Lean could work at all if it was imperative as opposed to a purely functional, dependentally typed language

      Replies (1)
      1. For general software engineering, which is the topic of the article, not math proofs
        Replies (1)
    4. You run your program in a host that does all the icky side effect things.
    5. There are plenty of people solving real problems with Haskell, enough to pay their bills.