The need for a formally verifiable mainstream programming language
todsacerdoti
321 points
303 comments
November 27, 2026
Related Discussions
Found 5 related stories in 49.0ms across 4,908 title embeddings via pgvector HNSW
- So you want to build a mainstream formally verifiable language mpweiher · 105 pts · November 29, 2026 · 82% similar
- What formal verification is in reality encyclopedism · 31 pts · December 03, 2026 · 55% similar
- Evergreen: A Provably Safe Systems Language jordan_bonecut · 104 pts · November 04, 2026 · 53% similar
- Formal Verification Is Not Verifiable zdw · 166 pts · November 14, 2026 · 52% similar
- How the Claude Code team thinks about verification craigmart · 278 pts · November 17, 2026 · 51% similar
Discussion Highlights (19 comments)
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
JacobAsmuth
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
agnishom
How will having a formally verifiable mainstream language save us?
lioeters
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
pjmlp
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.
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
JodieBenitez
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.
globular-toast
Is it part of the joke that the first two links in the post are 404s?
skybrian
Perhaps Zena is worth looking at since it also targets WebAssembly GC? https://zena-lang.dev/
Snibz
I don't really understand this sudden obsession in the industry with formal verification
protocolture
> 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.
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.
FullGarden_S
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.
grohan
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.
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.
0815beck
"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
Qasaur
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.
light_hue_1
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!
ChicagoDave
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.