60 comments

  • hresvelgr 2 hours ago

    "Beware of bugs in the above code; I have only proved it correct, not tried it." — Donald Knuth

    Formal correctness does not guarantee desired function. People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability. You cannot just throw formal verification at a problem.

    I am very much of the opinion that crap code is an issue of organisation and aesthetics, and that can be automated. This is something that is enforced by frameworks, and despite the popular consensus that LLMs are good at frameworks because of training data, I make another argument that LLMs are good at them because frameworks massively restrict the possibility space of code that can exist and enforce a consistent organisation and aesthetic. The solution as I see it is to make more restrictive frameworks that have a higher chance of producing desired functionality, then afterward we can worry about correctness.

    [1] https://jepsen.io/analyses/particledb-1.1.4

    • kubb 9 minutes ago

      I don't get this broken logic. A software engineer should have elementary reasoning skills.

      "Formal correctness doesn't guarantee desired function, therefore we don't need it."

      But in reality it will actually catch bugs, in addition to other verification methods, and give more confidence in software.

    • FridgeSeal an hour ago

      > People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability

      Given how vibe coded the rest of that whole DB appears to be, and the number of holes the Jepsen test found, I’m not terribly sure I’d trust, or use it as an example of “used formal methods”.

      A better example would be the AWS S3 team who used TLA+ to formally verify their permissions model, especially around whether something was publicly accessible.

    • vikramkr an hour ago

      The same limitation is true of every other method of verifying and validating software too. You can have 100% unit test coverage and still have nothing work. It's another tool in the toolkit and a pretty powerful one

      • alphanumeric0 41 minutes ago

        The "it's not a silver bullet, thus not worth mentioning ever again" argument is getting tiresome.

    • latentsea an hour ago

      Quite ironically I see formal methods being extremely key to your central argument. That is, the design should be started by modelling with some formal language that then gets expanded into an implementation. I fully agree about massively restricting the possibility space of code as being why they work. I've found that to basically be the only thing that produces consistently good results in the face of all the non-determinism. The entire codebase doesn't fit into the context window though, but formal models of it can act as some form of lossy compression that helps it fit into the context window better. I think formal methods definitely have a role to play, as to do anything that restricts what the valid moves are like frameworks and fitness functions etc.

      • hresvelgr 25 minutes ago

        > Quite ironically I see formal methods being extremely key to your central argument.

        Formal verification is a useful tool, but I don't think it meaningfully combats "slop," which I argue is primarily disorganised, voluminous, and lacking in aesthetics.

        > That is, the design should be started by modelling with some formal language

        I would make sure what I am developing demonstrably works before formally verifying the characteristics of the system.

    • ggm an hour ago

      Our first year CS Pascal lecturer in '79 used to quip "I've compiled this but not run it" and I used to think this was savage but I now see he was simply repeating the mantra. The Fortran I did on cards in '76 they insisted we run, and learn the cost of sloppy code in the debug cycle through batch processing cycle costs.

    • remywang an hour ago

      > ParticleDB’s home page advertised that ParticleDB was “formally proven” with a TLA+ proof. However, during our collaboration no TLA+ specification was available. It is unclear what properties might be proven, or whether they described ParticleDB as built.

      That link is a pretty weak strawman. Also TLA+ is special in that it (usually) does not directly verify the implementation but a model of it.

    • globular-toast an hour ago

      Frameworks often lead to crap code because people don't recognise when they're doing something the framework isn't good at. Do we expect LLMs to be better? So far they're a lot worse and will happily churn out reams of code that would make even the worst programmer stop in their tracks questioning whether this is right.

    • behnamoh an hour ago

      > Formal correctness does not guarantee desired function. People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability.

      Boris said they heavily use TLA+ for Claude Code and they've noticed an improvement. Comparing CC with 6 months ago, it has indeed improved in terms of reliability and screen flicker, etc.

  • porcoda an hour ago

    Dafny, SPARK Ada, Why3, Verus, Frama-C, TLA+, etc. are all sort of in this direction for different languages and styles of verification. It is nice to see them getting attention now that LLMs make them digestible for a broader set of programmers. I'm not sure one can start with a goal of creating a "mainstream" language that is verification-oriented. Mainstreamness comes from adoption. I'd look at those past languages (like the ones I listed), and ask "why did these not go mainstream" or "why did they not see broad adoption", and try some new ideas to address their gaps to see if a new one will catch on. But the "mainstream" part seems backwards as the goal - if it’s verifiable, ergonomic, flexible, and accessible, maybe it will go mainstream.

  • spankalee 30 minutes ago

    Wow, I feel like Blaine is describe a language a lot like the one I'm working on now, Zena: https://zena-lang.dev/

    I started Zena from wanting a TypeScript-like syntax that compiled to very efficient WebAssembly GC, and AssemblyScript had issues...

    The motivation for targeting Wasm was as a good sandboxing and orchestration unit for AI-generated code. So, out of both general PL curiosity and enthusiasm, and an attempt to make a language that's good for AI generation, I started adding what I thought were the best features from other languages with a lot of focus on correctness, structure, and optimizability: pattern matching with exhaustiveness checking, ADTs and sum types via sealed classes, value types, async cancelation / structured concurrency, ownership and borrow checking for resources, unicode safe strings, and recently I added runtime contracts and I'll start on refinement types and some kind of proof system soon.

    The idea is exactly to take a mainstream and familiar-looking language and add more cutting-edge and academic features that help with software correctness.

    I wrote about some of this here, though not the formal methods parts: https://zena-lang.dev/blog/2026/09/languages-for-the-ai-era/

  • jupake 12 minutes ago

    Isnt this exactly what Ada language was created for? Hence, the use by the military for avionics and critical systems.

    "It also includes facilities to help program verification. For these reasons, Ada is sometimes used in critical systems, where any anomaly might lead to very serious consequences, e.g., accidental death, injury or severe financial loss. Examples of systems where Ada is used include avionics, air traffic control, railways, banking, military and space technology."

    All that was once old, is new again.

  • pianopatrick 28 minutes ago

    If you want a language that is mainstream and applies formal verification and works everywhere you could use Frama-C. It formally verifies C code. C is as mainstream as things get. You can run C code in the browser via web assembly and C works everywhere else as well.

  • microflash 14 minutes ago

    I’ve been playing with Quint [1]. Compared to TLA+, it has been a lot more approachable and even enjoyable at times. With their Studio, even non-technical people have been able to try it out with agents.

    [1]: https://quint.sh

  • hedonhermdev an hour ago

    https://github.com/verus-lang/verus

    The lab I worked with for my thesis used Verus for our formally verified Operating System written in Rust. https://mars-research.github.io/doc/2023-kisv-atmo.pdf

    • freakynit an hour ago

      So, we write formal "code" to verify target "code"? How does this help?

      • DangIsATyrant 38 minutes ago

        I know nothing about the above project, and am not speaking on it, but you could probably walk into a room full of schizd out AI addicted VCs and say "Rust, verified, operating system and programming language" and walk out with $20 million.

        • techpression 20 minutes ago

          Add AI before operating system and you’re looking at $2B

  • aenis an hour ago

    30 years ago, my then boss, a PhD in industrial automation theory, told me formal verification of even simple systems is impossible due to the practically infinite number of states systems can occupy. I have been thinking about this a lot over the years, and I still think this is the case, even more so than before with the bloat that introduces insanely fuzzy edges to any state graph. I wonder if there is really any chance of this becoming a viable concept for systems more complex than a tic-tac-toe game.

    • Retr0id an hour ago

      It's possible to design with verifiability in mind (e.g. something like seL4)

  • JacobAsmuth an hour ago

    Sounds like you'd be interested in Qed! The web framework I'm building which compiles lean to native js for the frontend and rust for backend, using prorobuf for communication between the two.

    I reimplemented the entirety of the css grammar and fully verified the data model, hydration/dehydration pipeline, and can even formally prove accessibility properties at compile time (e.g. contrast > 4.5).

    I'm currently working on reimplementing the full sql grammar to allow you to formally verify your queries (and even row level security policies!) at compile time.

    https://github.com/JacobAsmuth/qed

    • robin_reala an hour ago

      I’d be wary of saying “formally prove accessibility”. Leaving aside the problems of computing contrast over differing surfaces (e.g. a gradient, and image or an animated surface) on a responsive site at build time, accessibility is a vastly bigger subject than just colour contrast and focusing purely on compliance to a set of rules isn’t going to get you very far.

      Or rather, zero problem with accessibility linting, but don’t oversell it.

  • magoghm 35 minutes ago
  • FullGarden_S an hour ago

    We do not need a full-on theorem prover for achieving this.

    Something like ZFC axioms is good enough. External formal verification tools are not ideal either. Its better if the type system of the host language's got these essentials included, like having a model checker for its abstract machine or something. However, model checker for enforcing correctness(especially of the intent) will be much harder to implement in languages without a well defined, stable ABI and type system, which typically is the case with almost all mainstream languages. Even though operational semantics is the semantics of the hardware, most languages do not strictly adhere to it due to a lot of practical reasons.

    Mainstream languages that become practical enough to be used by masses will usually be in a spot where it becomes very hard to formally define the language and when that happens, enforcing "correctness" becomes close to impossible. Stuff like this needs to be addressed since the start.

    Selling to the entire industry the idea that "memory safety" is the only thing essential security requirement, while all else is a low priority, simply means that anyone who bought that ad either had surplus resources or was operating with inadequate requirements to justify doing so. Computer programming is about deductive reasoning of the programs and that means its much more than just writing code and handling resources properly.

    • 0815beck 43 minutes ago

      this doesnt even make sense.... what do you mean

      • FullGarden_S 30 minutes ago

        I updated my reply to be more explicit.

    • mrkeen 21 minutes ago

      > Something like ZFC axioms is good enough.

        Axiom of Infinity - There exists an infinite set.
      
        Axiom of Replacement - If a function is defined, then for any set, there exists a set of images under that function.
      
      Why would these help me?
  • unignorant an hour ago

    I've been working on something similar that compiles to WebAssembly without GC and can give a proof/verification layer (though demonstrated with Bend rather than Lean). Unlike the author's approach, it has a C-like type system combined with Racket-style metaprogramming that allows for the higher-level layers (e.g., memory safe languages, dependently typed languages) to be defined defined as importable libraries. This allowed the core to be really small (<12k LOC), flexibility for future experimentation on the right kind of verifier, and enabled an initial self-bootstrap.

    I won't share a link here as I tend to dislike replies that advertise personal projects, but I thought this difference in approach might be interesting to the author or others (I went through a somewhat similar evolution to the author in my thinking).

  • Snibz an hour ago

    I don't really understand this sudden obsession in the industry with formal verification

    • lz400 an hour ago

      I think it's simple to understand. Most code is now written by LLMs and the bottleneck is verification. If with a few more tokens thrown at TLA+, Lean, etc. we can achieve _guaranteed_ correctness, it's an amazing deal. I'm not saying it's possible or even that it works that way, but that's the dream.

      • DangIsATyrant 41 minutes ago

        Engineers would rather make their own jobs obsolete than have to code review AI code it seems.

      • drdrey 10 minutes ago

        except that no one wants to formally specify actual correctness properties

    • lioeters an hour ago

      Au contraire, it's both horrifying and impressive that so much of the software industry has grown for decades without formal verification. With the accelerated production ("productivity") of machine-generated code, we're at a threshold where it will become impossible to manage the complexity unless we change our ways.

    • protocolture an hour ago

      1. It sounds cool.

      2. ????

      3. Post Human Singularity or something

  • skybrian an hour ago

    Perhaps Zena is worth looking at since it also targets WebAssembly GC?

    https://zena-lang.dev/

  • agnishom an hour ago

    How will having a formally verifiable mainstream language save us?

    • m00dy an hour ago

      probably won't. But, it will keep some people busy for sometime.

  • ChicagoDave 38 minutes ago

    Again the OP makes the provably incorrect assumption that the current state of code generation and validation cannot meet quality standards.

    I’ve been doing it with a custom engineering harness on top of Claude Code for a year.

    I certainly see the desire for a validation framework in code generation, but until we invent that and migrate the entire world to it, let’s focus on discipline.

    The reality the OP sees isn’t wrong. Most of what I see publicly is trash. Undisciplined vibe coders are in a death spiral of agentic madness.

    But if you bring discipline to software construction, you can extract high-quality results.

    We still need requirements. We still need invariants. We still need wireframes. We still need user experience design.

    Then we reach into history and bring back Functional Design Specifications.

    Add TDD, DDD, behavior testing, mutation verification. And finally people need to use it for the final validation.

    Now you have a disciplined approach that works today.

  • lioeters an hour ago

    Related project I saw recently:

    > TScert: a sound core for TypeScript. An independent checker, whose soundness is proved in Lean

    https://github.com/cristianoc/TScert

  • moneybunny 7 minutes ago

    Are we going to write backend in lean now or who is gonna train ai with a brand new lang?

  • supermatt 18 minutes ago

    I couldn’t read past the first paragraph.

    What are people doing that they are finding quality is nose diving? That’s completely the opposite of my experience. I’d like to know, but the link is broken

    But of course software engineering has always had this problem, right? Oh! Another broken link.

    Maybe we need to start closer to home when it comes to quality.

  • Qasaur an hour ago

    The author’s proposal reminds me of the JavaScript framework craze. Industrial-scale formal verification does not require a new language unless your program involves exotic types and/or logic not supported by any of the mainstream languages. There is still lots of work to be done, of course, but projects like Rust’s Verus and Aeneas already provide a clean and modular interface to plug in a formal methods layer, like Lean, without needing to reinvent the wheel.

    Seamless formal verification requires a native formal specification to verify against. In my view, focusing work on formally modelling existing languages (like Rust), or if intractable at least a fragment with Cartesian closed semantics, is far more encouraging to mainstream adoption of formal methods than trying to convince the industry to adopt a new language.

  • Nursie 4 minutes ago

    > The only way forward is to fully embrace formal verification, all the way down to the foundations ... But that's easier said than done. Existing formal verification tools suffer from massive usability and understandability problems, and have failed to make any kind of noticeable impact ...

    This is sort of a counterpart to my own opinion of formal verification, since first learning about it 30 years ago.

    Firstly, if there's no direct link between the written code (or perhaps even the program code post-compilation) and the verification algebra, what are you really verifying? And secondly if we can 'get by' without it very well for the most part, then justifying the extra effort is very hard.

    And I would argue in contrast to the author that we have achieved a hell of a lot without using it particularly widely. Much like that late-90s obsession, the semantic web, it illustrates a major disconnect between assumptions in the halls of academia about how the world should work, and real world industry practice.

    So if there is value in formal verification then the author is right, if must be applicable directly to the program code under verification, and I would argue it must be low friction if it's going to get adoption. And I think LLMs can probably help us deliver that last part.

  • pjmlp an hour ago

    This will never take off without the proper incentives to make companies actually care.

    Management would rather have vibe coding as the next step, following on cheap offshoring, than anything else, and the recent meltdowns aren't going to deter them, without liability in place.

  • 0815beck an hour ago

    "i want to formally verify the program" should be met with the same reaction as "i want to prove that this is true", namely WHAT, what exactly do you want to prove

  • techpression 13 minutes ago

    A programming language is more than compilation, which I feel the post misses. I pick language because of its runtime properties and quality of life, I don’t want to reinvent every foundation in every project with a barebones language.

  • grohan an hour ago

    Formal verification is not a silver bullet! I am afraid AI has positioned it as the ultimate red herring (and nerd-snipe).

    I recommend reading Cantwell Smith's "The Limits of Correctness" https://dl.acm.org/doi/pdf/10.1145/379486.379512

    The TL;DR is that proofs only show that the program matches a spec, not that the spec matches the world. The gap between "what you can model" and "the real world" is generally too large for formal methods to be useful (outside of narrow domains, where they are highly useful).

    In other words, computing is closer to an empirical science than a formal one.

  • aloisdg an hour ago

    F*?

  • globular-toast an hour ago

    Is it part of the joke that the first two links in the post are 404s?

  • baq 30 minutes ago

    Somebody call Victor Taelin

  • ezekiel68 33 minutes ago

    Obligatory: "...or else, what?"

    If it's truly needed, it will appear (or has appeared already) in one form or another.

  • light_hue_1 an hour ago

    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!

    • filipdobro 27 minutes ago

      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.

      • slacknatcher12 10 minutes ago

        > 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).

    • slacknatcher12 21 minutes ago

      The haskell community has practically settled on StrictData for years now... Alexis King gave the final blow on. Old complains never die though.

  • JodieBenitez an hour ago

    Yet another article claiming software quality is "nose-diving" because of AI, while we're piling [insert anything]2root exploits based on decades of real human sloppiness. Meanwhile, in-house software keeps getting better.

  • protocolture an hour ago

    > fully embrace formal verification, all the way down to the foundations of our civilizational software stack.

    I am getting so tired of LLMs being used as leverage for people to basically thrust their random viewpoint and make it all philosophical.

    "LLMs mean my thing is best and everyone needs to do it or become post-civilizational transhuman paperclips"

    I almost wish the stupid AI safety sex cult could convince Sanders and Trump to nuke us back to the stone age if only to save us from the onslaught of low-quality bad faith takes.