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

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

311 points by todsacerdoti 19 hours ago | blainehansen.me | 299 comments on HN

View full thread · View on Hacker News

Comment thread (5)

  1. LLMs don't care and can just as easily keep track of them as separate concerns.

    Only if they have the context of every part of the code though. If you put type hints in your code then the LLM can understand the shape of what some code is supposed to send/receive without having to trace back through the code to the source of that data. That means a model with a much context window can successfully change it. That's both cheaper and faster.

    Also, we can still do things without LLMs. You can compile and test code as a part of CICD, and having something doing a static type check is a good quality gate.

    Maybe in a future where we run models locally that's not an issue, but if Anthropic 100x their prices tomorrow I'll be glad I left some aspects of development working without LLM input.

    Replies (1)
    1. > Only if they have the context of every part of the code though.

      Why?

      > You can compile and test code as a part of CICD, and having something doing a static type check is a good quality gate.

      Nothing about separating concerns precludes that, of course. Most serious validation languages already avoid the intertwinement. It's not exactly a new concept. The trouble is that humans often find it hard to keep track of both at the same time, so we trick them into thinking it is one language to get around that (typically at the cost of lesser validation). But LLMs do not have the same trouble.

      Replies (2)
      1. Why?

        A type hint says "only accept things that look like this" and a compiling or a type checker can statically analyse the code to make sure that's valid everywhere. If you don't have that then the LLM would need to track back through the call tree to the originating point that defines the shape of the thing being passed to understand if it's valid all the way through the app in order to know that the data is correct. As it can't know where the originating call starts, it needs context of everything. It might only read the code it needs to read, and that can be done easily with an agent driving a small model, but it still needs complete access to every part of the app in order to trace what it needs to. With type hints it can just run the type checker to validate the code is OK and then trust the type hints.

        Replies (1)
        1. > If you don't have that

          Why wouldn't you have that? It is looking more and more likely that you accidentally replied to the wrong thread.

      2. LLMs have a limited context window. They also have trouble keeping track of what's going on "elsewhere", at least if there's enough of it.