Software engineering is in crisis because of LLMs, and only formal verification can save it

The need for a formally verifiable mainstream programming language

LLMs are accelerating sloppy software practices to machine speed, and quality is collapsing. The author argues that the only real defense is formal verification adopted by ordinary industry engineers, not a small priestly class of researchers. He outlines a revised, pragmatic vision for his project Magmide: a verifiable language compiling to WebAssembly with GC, a Rust-inspired type system minus the borrow checker, and SMT-powered Liquid Types and Flow Effects, with Lean added later as the proof layer.

Proof assistants guarantee that proofs are correct, but correctness alone is not enough. Someone has to read the theorem statements and confirm they capture the intended mathematics. This is the human contract that no amount of automation can eliminate.
  1. markhermeling

    Well written piece and certainly on-topic. There is a ton of conversation going on how AI can assist with formal methods.

    Personally I am having great success using Ada SPARK. The SPARK subset has been greatly enhanced over the past years. I spent yesterday taking existing C repos, translating to SPARK, lifting it to SPARK Silver (absence of runtime errors) and then reporting the findings to the various maintainers. All as a background activity.

    Result: integer overflows, typically on boundary conditions, some logic mistakes, again on boundary conditions.

    I have not looked into Magmide, but I think the next breakthrough is a combination of something like SysMLv2 to describe architecture and requirements, TLA+ for modeling and formal proofs at the system level and then Lean or SPARK for the implementation.

  2. spankalee

    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/

  3. porcoda

    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.

  4. Buttons840

    The author has another blog post about Flow Effects[0]. They propose an open-ended set of effects you could attach to functions, and then verify, at compile time, that certain functions either do or do not invoke certain effects.

    So if I had some functions like:

    foo_1 (must NOT access the HDD)

    foo_2

    foo_3

    foo_4 (does access the HDD)

    Only 2 of them are annotated with effects related to HDD access, but we can verify at compile time that foo_1 does NOT invoke foo_4, either directly or indirectly (we can verify this recursively).

    Perhaps foo_3 calls foo_4, but we forgot to annotate foo_3 with the proper effect. No matter, because foo_3 would automatically inherit the effects of foo_4 by virtue of calling it.

    This is just one of the feature the blog advocates for, and I think this feature alone would be quite simple and helpful in wrangling LLM code.

    A nice thing about this is that it's optional. You can annotate the effects gradually into existing systems.

    [0]: https://blainehansen.me/post/flow-effects/

  5. Animats

    There are a reasonable number of candidate programming languages. That problem has been addressed before.

    The big problem now is specification. If the specification is too formal, it's too long and too hard for humans to read. We need something in between.

    There aren't many candidates. There was UML, but that was something of a dud.

    Consider a specification at roughly the level that Rust crates are documented.

    Rust crate documents contain all the exported types and functions, along with a textual

    description of what each does. The document should provide enough information to use the crate without looking inside it. That's a widely accepted form of documentation.

    Rust crate documents are usually created from the code. But consider going the other way. Write the crate documentation first, and let an LLM implement it from there.

    With an LLM creating the code and reading the documentation, the LLM can create formal contract constraints for proof purposes. Constraints visible at the API level can be re-exported to the document.

    That seems within reach of current LLM technology. Is it? It's worth trying. Take some low-level crate documentation for existing crates and see what an LLM with a moderately large budget can do with it. Try to create a drop-in replacement.

    Doing this on low-level Rust crates would be a useful exercise. Try to formalize the bottom of the stack.

  6. aenis

    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.

  7. jupake

    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.

  8. hresvelgr

    "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

  9. ianjbutler

    Unification of programming languages and modeling languages is the holy grail of course, and it’s certainly no longer a pipe dream, but we suffer much from ignoring the easy wins in the middle ground.

    We could iteratively move towards this sort of thing by basically programming more directly with more formal stuff more often, basically thinking in terms of automata, process algebras, graph algorithms, etc. that’s the real design vocabulary now, not something like loops or objects

    For example.. abstractions from FSMs to kahn processes whatnot can all compile to Petri nets, and suddenly you can embed a formally checked subset of a classic and well understood control flow or dataflow or graph transforms, but using the idioms available in your language (decorators, templates, annotation). You write the formal model and the informal implementation side by side, using each to generate/elaborate/constrain the other. There’s only one whole but it has two distinct views, neither of which is complete or standing alone

  10. hedonhermdev

    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

More from this day

2026-11-27