‹ BackHN Continuity

Thread

Bend 2 and the Vibe-Coding Trap

327 points · 235 comments · LiamPowell

  1. LightMachine · · focus · HN ↗
    "The developer has built an entire language around a field seemingly without realising that said field exists."

    That is incredibly funny.

    Here's a talk about formal verification I made 7 years ago @ DevCon:

    <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=0fg1QbeeqNU" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=0fg1QbeeqNU

    Here&#x27;s Cedille Core, my implementation of Aaron Stump&#x27;s self types, a Computer Science professor who taught me a lot, ~8 years ago:

    <a href="https:&#x2F;&#x2F;github.com&#x2F;VictorTaelin&#x2F;Cedille-Core" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;VictorTaelin&#x2F;Cedille-Core

    I also implemented Kind-Lang 5 years ago, way before LLMs:

    <a href="https:&#x2F;&#x2F;github.com&#x2F;higherorderco&#x2F;kind" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;higherorderco&#x2F;kind

    I dropped out of Federal University of Rio de Janeiro to study this subject independently, because I was passionate about it, and I spent nearly 10 years doing so, daily, on weekends. That&#x27;s what I do.

    Bend proofs being verbose has nothing to do with me not knowing that inference, unification, or program search exists. Kind had these, 5 years ago. In fact, I&#x27;ve also been researching the later, and I built SupGen, which overperforms every published symbolic program synthesizer in the literature by 10x or so. This is unpublished yet, but you can find my posts about it 2 years ago on X (I&#x27;m @VictorTaelin).

    So, why is Bend verbose???

    Because it makes it fast. It is intentional. It is my vision that a good proof language should be fully explicit, because this reduces proof-checking time significantly. That is what makes Bend realistically 10x-100x faster than every alternative.

    But wouldn&#x27;t that mean it is much harder to write it?

    No. As you said it yourself, we have tools that can fill these proofs today! Not just AI models. You can apply these tools to produce Bend proofs, while the language itself remains a thin, dumb proof kernel that does one thing, and does it well.

    If nobody is reading these proofs (because they&#x27;re written by AI and automated tools), then, it is, in my opinion, irrelevant, as proofs will eventually become a layer nobody looks at, just like generated assembly.

    Of course, I could be wrong here!

    But it is misleading, if not just a bit malicious, to claim I &quot;vibe-coded&quot; a language without knowing about a field I&#x27;ve spent a decade researching about.

    Every single part of Bend is an intentional choice I made after considering every alternative. I use LLMs to fill code after I make all hard architectural decisions because they type faster than me, and I&#x27;d rather spend my time doing useful experiments than typing trivial functions, even though I could.

    Incidentally, deciding what I should NOT include took me way more time and effort than any line that was shipped, and there are perhaps millions of lines of code, manually written by me, that I threw away, backing up these 4k that went into the final design. An artist once told me you must first paint a Rembrandt before you can draw a cartoon that&#x27;s simple in the right way, yet that might mislead someone who has never drawn into thinking you don&#x27;t know what you&#x27;re doing. I guess.

    1. LiamPowell · · focus · HN ↗
      &gt; But it is misleading, if not just a bit malicious, to claim I &quot;vibe-coded&quot; a language without knowing about a field I&#x27;ve spent a decade researching about.

      Sorry. See the edit at the top if you haven&#x27;t already. I didn&#x27;t realise how much it came off as a critique of you rather than a particular approach to software engineering.

      It&#x27;s easy to write something and have a model of what you&#x27;re writing in your head that is massively different from how someone else will read it without realising, not that that excuses it.

      ---

      I disagree with LLMs manually writing proofs without other tools doing all the work they possibly can ever being a good solution for a couple of reasons:

      1. Tokens are really expensive when we have a LLM spending hours hacking aware at a proof, not to mention generating those tokens is slow.

      2. The context window becomes flooded with proof work rather than work on the original problem, which will lead to a worse solution. LLMs are demonstrably worse at writing code when you continue a session on a new task instead of starting a new one.

      &gt; It is my vision that a good proof language should be fully explicit, because this reduces proof-checking time significantly.

      We can cache the results and help the checker along with assertions rather than throwing out all the smart parts of the checker.

      1. dwohnitmok · · focus · HN ↗
        I would encourage you to think more deeply about the assertions you&#x27;re making here.

        I&#x27;ve done a fair amount of work in this space as well, specifically my main toolbox of formal verification tools in the past have been Rocq, Idris, Dafny, and TLA+, and I can say that I&#x27;ve come away with roughly the same set of tradeoffs as what LightMachine describes in his comment.

        Current formal verification tools are often very slow precisely because they try to reduce the number of lines of code that are required to write a proof. By making proofs more verbose and more explicit, proofchecking is sped up immensely (my own experiments check out with what LightMachine is saying here; indeed I&#x27;ve seen even greater speedups in the range of 100-1000x).

        It makes far more sense to pay a series of one-time costs in LLM tokens that reduces your compilation time from 1 hour to 1 second than to pay the 1 hour compilation cost again and again (these are not exaggerated numbers for larger projects). This is especially true because with modern LLMs, it&#x27;s usually just fire and forget and let it churn in the background than anything else.

        Caching and incremental compilation has a lot of limitations, e.g. for CI. This is the promise that languages like GHC Haskell have promised for a while that always gets blown away by the other side like OCaml where global compilation is just so fast that you don&#x27;t have to deal with those limitations.

        1. LiamPowell · · focus · HN ↗
          You don&#x27;t have to let the ATP do everything, you can speed it up immensely with well placed assertions where it struggles. Maybe a hybrid approach is best where we run ATPs with a very low timeout to get all the easy stuff and then have a LLM write a proof using the thereoms that the ATPs were able to prove.
          1. dwohnitmok · · focus · HN ↗
            &gt; You don&#x27;t have to let the ATP do everything, you can speed it up immensely with well placed assertions where it struggles.

            This is basically what you do with Dafny. I&#x27;m not very happy with this, not least of which is because it makes for an inferior developer experience in my opinion and because in general you are pretty limited in expressiveness of propositions.

            Also it&#x27;s kind of weird to be fixated on ATPs, as those are more or less a different level of abstraction from the language. You could develop an ATP for Bend.

            More generally speaking, the largest, most well-known formal verification projects that verify actual code don&#x27;t really rely on ATPs. SeL4 relies on explicit proof terms, CompCert relies on explicit proof terms, etc.

        2. sayon · · focus · HN ↗
          Silly question, but in Rocq, just for example, what does prevent you to fire `auto`, then, when it solves the goal, to just substitute it in your proof with the term that it constructed? Not calling you on BS, but genuinely interested in the problem
          1. dwohnitmok · · focus · HN ↗
            This significantly helps compile times, but will still end up with something far slower than Bend. What was I was talking about and presumably what LightMachine is talking about is how Bend is significantly more verbose than Rocq because even if you wrote out everything with terms, Rocq is still substantially slower than Bend, because Rocq relies a lot on implicit machinery (much more significant elaboration, implicit args, etc.) that slow down compilation.
Open on Hacker News to reply ↗

Unofficial Hacker News client; not affiliated with Y Combinator.