<- Back
Comments (123)
- hresvelgr"Beware of bugs in the above code; I have only proved it correct, not tried it." — Donald KnuthFormal 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
- spankaleeWow, 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/
- porcodaDafny, 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.
- aenis30 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.
- hedonhermdevhttps://github.com/verus-lang/verusThe 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
- jupakeIsnt 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.
- microflashI’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
- pianopatrickIf 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.
- JacobAsmuthSounds 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
- d_trI have started my own PL project after going through Crafting Interpreters.I know there is a ton of stuff I need and want to learn but no language has all the features I'd like.Namely systems language "zero overhead" performance, modern ergonomics and compile-time guarantees like Rust, dependent types (I don't know much about type systems so maybe there is - and probably there is - some good alternative I am missing), powerful generics (the shit people do with C++ templates often leave me admiring the creativity and also wondering why it has to be so unreadable), reflection, and more stuff I currently have as ideas but not in a very solid form admittedly. And all those working synergistically and coherently.I do have a good foundation in abstract math but there is lots to study for sure. And it has to be something that really offers some great combination of features otherwise it's not worth it for anything else than me learning how to write a proper compiler. There are too many languages already, but I am not sure whether this is because it is too hard of a problem or because of choices people made. I guess I am going to find out.At least my motivation is in a relatively sufferable shape despite it having tendencies of going down the shitter with all this vibe-coding crap going on.
- anonundefined
- FullGarden_SWe 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.
- jb_briantFormal correctness is mostly useless for mainstream software. Models are strong enough that their bottom 10% of code is acceptable garbage, like in any human codebase. Top 10% is excellent.From my experience on vibed complex algorithms (like voxel terrain generation within 200km radius at sub second generation), formal software was usefull, if not necessary, prior to opus 5.5Now it's plain useless unless you need an absolute guarantee of correctness. But that's niche, not mainstream.So we don't need a mainstream programming language, we already have good options that are sufficient.
- kbr-For the barrier between natural and formal language, see Elenxis. https://github.com/kbr-/elenxisIt still plugs in LLM as a module, and LLM can be misaligned, so there is no guarantee that the spec will be 100% reflecting the user's intent. (I do know how to solve this, and I will in the future.)But even right now in practice, with Opus 5.5 or GPT 6.2 Sol (medium reasoning both) it works fantastic. I use daily at $dayjob and in personal projects.
- magoghmMaybe Bend? https://bend-lang.com/
- mirekrusinWhy not use/contribute to MoonBit [0]?It already checks boxes listed in the article:- wasm(-gc) target- uses gc- rust type system, without borrow checker difficulties- formal verification- ...and has few more like fast compile times, which is a must/underappriciated in agentic development (see below) etc.As an example I attempted to rewrite MSSQL 3 times:1. TS based on SQLite [1]2. Rust based on DuckDB [2]3. MoonBit [3]MoonBit version materialized more than order of magnitude faster compared to Rust version, tasks that were taking weeks in Rust took hours in MoonBit (!) – not only that, instead of using multiple build machines including maxed 128 GB RAM Ryzen box eating hundreds of gigabytes of SSD to support Rust worktrees / parallel compilation, MoonBit was run on MacMini M1 with 16GB RAM and limited disk space – still destroying Rust version in terms of development speed going more than 10x faster.Formal proofs is early stage support, you can see some of it here [4] if you're interested.If you find it somehow interesting, feel free to have a look at bitSQL repo/website [3] (it's public domain like all my recent projects), especially the final artifact which is a marvel – ~30 MB (!) of hardened container image, drop it replacement for MSSQL container – tiny, performant (wins all benchmarks against MSSQL), passes 25k tests, low resource usage (MBs instead of GBs of RAM needed) – what a beauty. Great for ie. running CI tests on projects using MSSQL.[0] https://www.moonbitlang.com[1] https://github.com/mirek/mssqlite[2] https://github.com/mirek/msduck[3] https://github.com/mirek/bitsql[4] https://github.com/mirek/bitsql/blob/main/docs/design/verifi...
- anonundefined
- peter_retiefThis is a new frontier, we do not need to be able to read the code so why do we even need a code editor, we need a completely new language that might use symbols, context, location, images and human langauge.
- acjeFollowing some of the same sentiment, let me offer my own thoughts on how hardware/software co-design also should change to enable both digital sovereignty and inherent defensibility. https://acje.github.io/systems/new_stack/
- SnibzI don't really understand this sudden obsession in the industry with formal verification
- agnishomHow will having a formally verifiable mainstream language save us?
- skybrianPerhaps Zena is worth looking at since it also targets WebAssembly GC?https://zena-lang.dev/
- singularity2001Bend is working on it and https://github.com/pannous/wap/
- lioetersRelated project I saw recently:> TScert: a sound core for TypeScript. An independent checker, whose soundness is proved in Leanhttps://github.com/cristianoc/TScert
- nightmunnasI would love to contribute to a project like this. What are the existing projects that try to achieve this?
- ChicagoDaveAgain 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.
- shevy-javaBut if AI is writing code for us now, do people need to learn programming? To me that's a chicken-egg dilemma. Some languages struggle getting new people to use them.
- aloisdgF*?
- austin-cheneyFrustrating. The repeated failure of developers trying to fix broken human behavior with a software solution.LLMs are not the problem. Quality will degrade anyways because there is no reason why it shouldn’t degrade. There is no magic to any of this. It’s just economics. Quality will remain high provided there is an incentive to keep it high, but once other factors achieve a greater desired value those incentives collapse.This is not a new problem and it has been solved countless times outside software. So long as software people continue to whine about the symptoms while intentionally ignoring the problem we should expect conditions to continue to degrade. A new programming language will not alter the trajectory or acceleration towards failure. Perverse desires always find a way.
- QasaurThe 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.
- pjmlpThis 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.
- supermattI 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 brokenBut 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.
- stsch"Quality is nose-diving" leading to a 404 is funny in this one. ;-)
- 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
- DashadowerUsability, strong verification guarantees, expressivenessYou get to choose 2 out of 3
- moneybunnyAre we going to write backend in lean now or who is gonna train ai with a brand new lang?
- grohanFormal 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.379512The 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.
- wseqyrkuIf you think you ever need anything more than rust, drink bleach. I mean if dealing with borrow checker is a hard pass for you maybe let's not talk about formal verification
- xiaoyu2006Just make Lean useful?
- DeathArrow1. When coding was done exclusively by humans we still had lots of bugs, inefficiencies, poorly written and poorly architected software.2. While at start LLM output was not great, models are continuously improving and the quality of coding by frontier models is good. (Even weaker models like Deepseek Flash can output high quality software if driven carefully)3. By analyzing the model output, having lots of gates, having good testing habits and by asking the models to manually test what they did, and constantly changing my workflow to improve the output, I am very happy with the results and probably my workflow using AI is of better quality than if I would do it by hand.4. If the software isn't of worse quality than if done by human teams with realistic constrains (time, money etc.), then using AI is a net gain.5. While striving for perfection is great, doing when to do compromises and trade-offs, is even greater.
- DeathArrow1. When coding was done exclusively by humans we still had lots of bugs, inefficiencies, poorly written and poorly architected software.2. While at start LLM output was not great, models are continuously improving and the quality of coding by frontier models is good. (Even weaker models like Deepseek Flash can output high quality software if driven carefully)3. By analyzing the model output, having lots of gates, having good testing habits and by asking the models to manually test what they did, and constantly changing my workflow to improve the output, I am very happy with the results and probably my workflow using AI is of better quality than if I would do it by hand.4. If the software isn't of worse quality than if done by human teams with realistic constrains (time, money etc.), then using AI is a net gain.
- globular-toastIs it part of the joke that the first two links in the post are 404s?
- Nursie> 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.
- techpressionA 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.
- light_hue_1If 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!
- baqSomebody call Victor Taelin
- ezekiel68Obligatory: "...or else, what?"If it's truly needed, it will appear (or has appeared already) in one form or another.
- JodieBenitezYet 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.
- bytepatterns[dead]
- exa_bit[dead]
- anonundefined
- oxcartctl[dead]
- DarrenEdwards11[dead]
- conrs[dead]
- twotwoone[dead]
- 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.