"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.
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.
> 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.
The author's text is actually about saving us from our misconceptions about LLMs.
Formal verification is one necessary building block, not the whole structure needed. You want to do Verification and Validation.
Currently, people have dollar signs over their eyes and don't see the perils their greed is leading them into.
You cannot substitute human expertise with LLMs. That's like believing your rational brain was superfluous and you'd be better off without it, relying on "others" (LLMs) instead.
Nobody in the public sphere has thought that through really. Apparently, they've become so accustomed to other people solving their problems when paid, they just assume it would be the same or better with "non-people", who don't even get paid.
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.
> 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.
The question is, why do we care about slop in the first place?
If we ignore the ideological and emotional reasons, I think it boils down to three things:
1. The slop is incorrect
2. The slop is bloated
3. The slop is not human readable
Formal verification together with human validation is the answer to point 1. The second point needs additional measures to keep the artificial author in check which is in my experience quite easy to accomplish.
If these two are in place I found that human readability falls out mostly for free.
So, to summarize, in my opinion formal verification together with measures to keep the code minimal and concise is our best way to tackle slop.
Personally, I think the slop is very dangerous to a codebase both when humans produce (and they do!!!) and when AI produces it because the uncontrolled growth of entropy in a codebase has this funny way of just completely trashing your ability to get anything done in it. Like, now there's two ways to do the same thing, so.. which one do you pick? Pick at random, now there's 30% this way and 70% that way, so probably the 70% one will get picked, but there's this non-zero chance that now a third way is invented! When you think about next-token prediction, it's so heavily conditioned on the context, that crappy context equals crappy results, and uncontrolled growth of entropy results in crappy context.
TL;DR it impacts the trajectory of the LLM negatively in a massive way IMHO.
Assuming a narrow definition of "incorrect", I would add:
4a. The slop has been generated with rules and processes, ones that needed actual decisions and approval which never happened.
4b. Nobody reading the slop can distinguish between deliberate things that were chosen and approved, versus accidental things which were blindly generated and kept.
Then I state signatures and conjectures that the spec must have. Properties that the future implementation must hold. No implementation yet.
Only once all conjectures are there, we are ready to roll.
If I write in Lean, I can now fill in the signatures' implementations. Then prove theorems. Proof doesn't go through => bug. Fix, retry, repeat.
If I write in an inferior language, there is extra Intermediate step: translating the conjectures into property test in the language. Only once these are ready, I can write implementation.
You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.
Interesting. I work in bog standard LOB SaaS type businesses my whole career, so zero practical experience with formal methods, but a growing interest in them due to how I see the industry trending towards them. Can I ask... in your case, what is $dayjob related to that you find yourself operating this way already? Finance? Aerospace? Just curious...
> You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.
Most software engineers don't really have a background in it, and tbh I kinda don't know where to start, and have heard that right now if you're already experienced with formal methods then you can get great results out of approaches like this with LLMs, but if you just vibecode up the Lean or TLA+ etc then you're not going to get out of it what you were expecting. I suspect your statement here is exactly the kind of thing that makes all the difference, but I don't know how to know what the other things that make the difference are. Any other pointers?
Note that the above is based on using classical logic predicates to "steer" the program through its "state space". This is the more fundamental and "simpler" approach since it uses only First-Order Logic.
Another way is to use the Type System (constructive logic, dependent types in Lean4 etc.) to embed the above directly into the program types. This is harder since you need Typed Lambda Calculus, Higher-Order Logic and need to think quite differently. For this you can read Types and Programming Languages by Benjamin Pierce and/or any number of lambda calculus books. The Curry-Howard Correspondence helps you understand this if you have some idea of the above state space approach.
It is all overwhelming at first if you are completely new to it so use it as a roadmap. Survey all of the above to get a grip on the jargon, notation and application and then choose your approach/logic/tool based on your interests/needs.
> Can I ask... in your case, what is $dayjob related to that you find yourself operating this way already? Finance? Aerospace? Just curious...
Nothing so critical.
My first serious full-time job was at ScyllaDB, where I worked on distributed database system core. My main area of interest (carried over from University) were distributed algorithms. There, formal methods are basically necessary; if you design a distributed algorithm and don't use formal methods, you *will* fuck up. In ScyllaDB I used TLA+.
Today I have a different job but my passion for formal methods didn't go away.
I updated my HN profile with link to my website, you can look me up.
Oooh that makes sense. Databases are one area I have definitely heard such methods being used. I remember seeing a talk on TLA+ by the CosmosDB people and thinking it was really cool.
Property test can state general properties about the signature being tested. E.g. let's say you're proving correctness of addition in an abelian group. You can state Associativity, Commutativity, Identity Element (0), Additive Inverse, Closure, Cancellation Property, as properties of the signature, in the Property Testing framework you're using (Haskell: QuickCheck, Python: Hypothesis, and so on). The framework will generate test cases using a specially-crafted random distribution (one crafted to maximize the chance of catching a bug), then if it finds a failing case, it will shrink it, so your counterexample is minimal.
It is a "normal test" except that you use a powerful framework to give you these mechanisms.
It still depends on randomness, so it's still inferior to a theorem, which gives you 100% correctness.
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
I think the problem is that rn a lot of people with experience with formal verification are theoreticians who aren't familiar with engineering pragmatism. Yes it's true that because something is formally verified that doesn't mean it's secure. The way we deal with that is, there are swarms of AI agents trying to hack everything of they succeed well there's your peer review. And in theory is is possible it's so subtly wrong that no AI at current capability levels can figure out the flaw and the system seems secure? Well in that case, mission accomplished it's not hacked. But what about if there's more powerful AI down the line? That's why we have to make sure to get the smarter AI first
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.
> 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.
You can instrument the code to capture production traces and then verify them against the TLA+ model though. I think a programming language with that baked in as a first class citizen would be compelling. That's sort of the direction this stuff is heading it feels like anyway. Model in a smaller language that's more precise, fits in the context window better, and can explore the state space much more quickly than reasoning token by token, then build the thing based off the model, then validate that the implementation conforms to the model.
> 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.
The flaw in people's thinking is "Formal verification means bug-free, and bug-free means it works correctly." ignoring the fact that most things that people call bugs are actually the code working correctly as it was written but it was written to do something that's either not what the requirement says or that the requirement doesn't actually say what the application should really do.
Requirements, code, verification, etc are a process to turn a human mental model of something into an process a computer can do. You can verify the computer's side of that all day long but if the human side is wrong no amount of verification is going to make your software do what you wanted it to do.
We don't really have a verification crisis, we have a validation crisis.
Ever more cycles spent checking we're building the thing right doesn't address the issue of whether we're building the right thing.
The debate has always been whether running cycles on "compile" which is checking against a largely fixed set of rules is better than "testing" which is checking against a largely dynamic set of rules. "Testing" tends to be able to do validation better than "compile".
That's been the running debate between dynamic typed and static typed computer languages for the last half century or so. It swings backwards and forwards.
Like centralised vs distributed I don't see there being "a" answer other than "it depends".
> the running debate between dynamic typed and static typed computer languages
Actually, I haven't seen a good dynamic vs static types debate for a long long time. Some of these fundamental debates have become tired and people don't debate them anymore, which is understandable.
But, in the age of LLMs, maybe it's time to have that debate again.
The major disadvantage of typed languages is they're harder to write at times, the type checker gets in your hair. But if LLMs write the code, what argument remains against static types?
> But if LLMs write the code, what argument remains against static types?
If by static types you mean where the verification language and the implementation language are intertwined, one has to ask: If LLMs write the code, what advantage is there to that intertwinement? That was a convenience function for human authors. LLMs don't care and can just as easily keep track of them as separate concerns.
Ruby and python were my introductions to programming. I picked up C and found the type system to just be annoying. Then I picked up a TS Node project that used Zod and it changed my perspective.
One of the primary structures that the project concerned itself with was written as a big fat z.object with all optional keys. In the logic, there were all kinds of runtime checks as nested if/else ifs looking for the presence of the keys and branching on their value if they existed. I discovered z.discriminatedUnions and realized that this could be checked once at compile time by defining the possible states of this structure, which progressed monotonically from one state to the next, never backwards
The logic then became a single comprehensive switch statement with an assert never default. Vastly simplified the rest of the application and obviated the nullish guards that were interspersed throughout the front- and backend logic. Life changing.
Now, I only use dynamic languages for trivial scripting or where the type system would be unneeded overhead. I am finding this to be rarer as my ambitions grow.
Also, the benefits of a good LSP provided by strongly typed languages with a robust ecosystem are huge. Makes reasoning about code so much simpler for me when I can peek any object's type in my IDE and go to definition. Ruby LSP is awful at this, you can't rename a variable globally nor can you go to a function's implementation if it cannot be determined. Not so with out-of-the-box tooling in strongly typed languages.
As a “creative programmer” I resonate with this strongly. While I think things like Lean and Rust are valuable tools which should exist, they only represent added friction TO ME.
> Formal correctness does not guarantee desired function
Rust doesn't guarantee desired function either. It doesn't mean that average rust program has the same probability to have segfault at runtime as a similar program written in C.
> People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability
That particleDB link is VERY unconvincing. All the folks I know who wrote a TLA+ spec have said that it helped them discover bugs. Just that it was a massive pain to keep maintaining code and spec independently.
However, I am confused on why new PL is needed. Why not just improve lean and its libraries so that it becomes a standard big-software language like Go/Java/Rust ?
To support in-place mutation and avoid unnecessary memory allocation, it would need some form of linear/uniqueness types, so the language can know when no other references to a type exist so it can be updated in place via mutation. Right now Lean achieves decent performance via https://xnning.github.io/papers/perceus.pdf , but it can't match what Rust can achieve.
There's another alternative - let most of the spec be derived from the code. Verus for example allows you to wrap your code in a verus!() macro and get a lot of the work for free and guaranteed to be in sync with the code. Even without any custom proofs, just that part provides a no-crash guarantee. (You still need to do some work though - it's not free)
The normal pattern is that the spec is shorter than the code, and therefore easier to get correct. That's why it's useful. Deriving the spec from the code therefore seems like going the less-useful direction.
Languages like TLA+ lay at the opposite end of the spectrum of how programs can be optimized. The more space you leave for optimization, the larger the search space becomes in evaluating the TLA models. The smaller the space you use for the models, the more constrained your optimizations become. It seems as though the two can’t be combined without finding an appropriate balance point at which point you’d probably have something very similar to existing languages.
Thank you. It's ridiculous how some people giddily reach for anything that remotely smells like a solution while unaware that they complicate things even more.
I wonder whether such a certificate will be a future requirement for selling or running certain hosted software. It would be hilariously German when the certificate then mandates using formally verifiable programming languages.
> People have written TLA+ specs for their software[1] and not have it materially improve the quality or reliability.
They have said they wrote them, but I doubt it. The quote from the report:
"We found several incompatibilities or bugs involving static or dynamic type safety, or behaviors that would normally have been caught by static analysis of a query, such as referring to a nonexistent column. These issues occurred with a single server, single client, and no faults.
They failed to catch references to a nonexistent column with a formal proof? I doubt it, the more likely explanation they hadn't proven their code, they probably did something that allowed them to claim that they wrote TLA+ specs, and stopped at that.
Formal proof is a static analysis on steroids, if it can't catch bugs that can be caught by a static analysis then what the point of it?
The report doesn't answer how it happened (I presume) because of: "during our collaboration no TLA+ specification was available. It is unclear what properties might be proven, or whether they described ParticleDB as built.
Linked article says they only said they had a TLA+ proof but none was actually provided and the rest of the article makes it clear that ParticleDB is pure vibeslop. I wonder who paid them to test it.
Favourite line:
> Under normal operation, ParticleDB was slow, deadlocked, and crashed without warning.
TLA+ proofs are detached from actual implementation.
If you have proofs attached to an actual implementation, things get much, much better.
For example, you can have type-checked distributed APIs (you can't omit a parameter for an HTTP request), you can have adherence to protocols checked at compile time (API calls sequences, etc), you can have many other things to be checked before any program run.
Formal methods may or may not help you. I remember Amazon or another company using TLA+ on a distributed system quickly found a bug that would've taken over two dozen steps to hit.
The concurrency bugs SPIN and TLA+ find also eat tons of debugging time because they are hard to replicate. They're often called heisenbugs for how they're there and not there depending on the observer.
Static analyzers with low, false positives catch tedious or corner-case bugs developers often miss. That already tells you that any formal method that makes software immune to those big classes will also improve quality. SPARK Ada and Frama-C both do that.
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
Replies (17)
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.
Replies (2)
The first paragraph is
> To save software engineering from LLMs, we need a mainstream verifiable language
Formal verification will not save us from LLMs, whatever it is we want to try and save (human civilization or programmers or users).
Replies (1)
Formal verification is one necessary building block, not the whole structure needed. You want to do Verification and Validation.
Currently, people have dollar signs over their eyes and don't see the perils their greed is leading them into.
You cannot substitute human expertise with LLMs. That's like believing your rational brain was superfluous and you'd be better off without it, relying on "others" (LLMs) instead.
Nobody in the public sphere has thought that through really. Apparently, they've become so accustomed to other people solving their problems when paid, they just assume it would be the same or better with "non-people", who don't even get paid.
https://www.youtube.com/watch?v=JUM77vJzM54
https://www.fogsecurity.io/blog/mistrusted-advisor-public-s3...
Replies (2)
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.
Replies (1)
1. The slop is incorrect
2. The slop is bloated
3. The slop is not human readable
Formal verification together with human validation is the answer to point 1. The second point needs additional measures to keep the artificial author in check which is in my experience quite easy to accomplish.
If these two are in place I found that human readability falls out mostly for free.
So, to summarize, in my opinion formal verification together with measures to keep the code minimal and concise is our best way to tackle slop.
Replies (2)
TL;DR it impacts the trajectory of the LLM negatively in a massive way IMHO.
4a. The slop has been generated with rules and processes, ones that needed actual decisions and approval which never happened.
4b. Nobody reading the slop can distinguish between deliberate things that were chosen and approved, versus accidental things which were blindly generated and kept.
Replies (2)
I start with prose requirements, then use Elenxis (https://github.com/kbr-/elenxis) to translate into formal Lean model.
Then I state signatures and conjectures that the spec must have. Properties that the future implementation must hold. No implementation yet.
Only once all conjectures are there, we are ready to roll.
If I write in Lean, I can now fill in the signatures' implementations. Then prove theorems. Proof doesn't go through => bug. Fix, retry, repeat.
If I write in an inferior language, there is extra Intermediate step: translating the conjectures into property test in the language. Only once these are ready, I can write implementation.
You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.
All of the above applies equally to AI agents.
Replies (4)
> You must not write implementation before having all conjectures stated -- otherwise the implementation will bias your thinking, and you will try to prove properties of your implementation instead of what you needed.
Most software engineers don't really have a background in it, and tbh I kinda don't know where to start, and have heard that right now if you're already experienced with formal methods then you can get great results out of approaches like this with LLMs, but if you just vibecode up the Lean or TLA+ etc then you're not going to get out of it what you were expecting. I suspect your statement here is exactly the kind of thing that makes all the difference, but I don't know how to know what the other things that make the difference are. Any other pointers?
Replies (3)
On Formal Methods Thinking/Levels and (In)Formal Methods - https://news.ycombinator.com/item?id=50478624
On Design By Contract (DbC) - https://news.ycombinator.com/item?id=50108540
On Combining Tests and Proofs with Contracts - https://news.ycombinator.com/item?id=50108206
On Correctness-by-Construction - https://news.ycombinator.com/item?id=49613696
Note that the above is based on using classical logic predicates to "steer" the program through its "state space". This is the more fundamental and "simpler" approach since it uses only First-Order Logic.
Another way is to use the Type System (constructive logic, dependent types in Lean4 etc.) to embed the above directly into the program types. This is harder since you need Typed Lambda Calculus, Higher-Order Logic and need to think quite differently. For this you can read Types and Programming Languages by Benjamin Pierce and/or any number of lambda calculus books. The Curry-Howard Correspondence helps you understand this if you have some idea of the above state space approach.
Finally, if you want to know/study the whole of above you need to read Understanding Formal Methods by Jean-Francois Monin - https://news.ycombinator.com/item?id=50506655
It is all overwhelming at first if you are completely new to it so use it as a roadmap. Survey all of the above to get a grip on the jargon, notation and application and then choose your approach/logic/tool based on your interests/needs.
Replies (2)
Nothing so critical.
My first serious full-time job was at ScyllaDB, where I worked on distributed database system core. My main area of interest (carried over from University) were distributed algorithms. There, formal methods are basically necessary; if you design a distributed algorithm and don't use formal methods, you *will* fuck up. In ScyllaDB I used TLA+.
Today I have a different job but my passion for formal methods didn't go away.
I updated my HN profile with link to my website, you can look me up.
Replies (1)
Continue this thread (1 replies) →
Replies (1)
Property test can state general properties about the signature being tested. E.g. let's say you're proving correctness of addition in an abelian group. You can state Associativity, Commutativity, Identity Element (0), Additive Inverse, Closure, Cancellation Property, as properties of the signature, in the Property Testing framework you're using (Haskell: QuickCheck, Python: Hypothesis, and so on). The framework will generate test cases using a specially-crafted random distribution (one crafted to maximize the chance of catching a bug), then if it finds a failing case, it will shrink it, so your counterexample is minimal.
It is a "normal test" except that you use a powerful framework to give you these mechanisms.
It still depends on randomness, so it's still inferior to a theorem, which gives you 100% correctness.
One could maybe combine this with Rust code verified by Aenas (which runs Lean proofs)
Replies (1)
Replies (1)
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.
Replies (1)
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.
"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.
Replies (1)
Requirements, code, verification, etc are a process to turn a human mental model of something into an process a computer can do. You can verify the computer's side of that all day long but if the human side is wrong no amount of verification is going to make your software do what you wanted it to do.
Replies (1)
Ever more cycles spent checking we're building the thing right doesn't address the issue of whether we're building the right thing.
The debate has always been whether running cycles on "compile" which is checking against a largely fixed set of rules is better than "testing" which is checking against a largely dynamic set of rules. "Testing" tends to be able to do validation better than "compile".
That's been the running debate between dynamic typed and static typed computer languages for the last half century or so. It swings backwards and forwards.
Like centralised vs distributed I don't see there being "a" answer other than "it depends".
Replies (1)
Actually, I haven't seen a good dynamic vs static types debate for a long long time. Some of these fundamental debates have become tired and people don't debate them anymore, which is understandable.
But, in the age of LLMs, maybe it's time to have that debate again.
The major disadvantage of typed languages is they're harder to write at times, the type checker gets in your hair. But if LLMs write the code, what argument remains against static types?
Replies (2)
If by static types you mean where the verification language and the implementation language are intertwined, one has to ask: If LLMs write the code, what advantage is there to that intertwinement? That was a convenience function for human authors. LLMs don't care and can just as easily keep track of them as separate concerns.
Continue this thread (2 replies) →
One of the primary structures that the project concerned itself with was written as a big fat z.object with all optional keys. In the logic, there were all kinds of runtime checks as nested if/else ifs looking for the presence of the keys and branching on their value if they existed. I discovered z.discriminatedUnions and realized that this could be checked once at compile time by defining the possible states of this structure, which progressed monotonically from one state to the next, never backwards
The logic then became a single comprehensive switch statement with an assert never default. Vastly simplified the rest of the application and obviated the nullish guards that were interspersed throughout the front- and backend logic. Life changing.
Now, I only use dynamic languages for trivial scripting or where the type system would be unneeded overhead. I am finding this to be rarer as my ambitions grow.
Also, the benefits of a good LSP provided by strongly typed languages with a robust ecosystem are huge. Makes reasoning about code so much simpler for me when I can peek any object's type in my IDE and go to definition. Ruby LSP is awful at this, you can't rename a variable globally nor can you go to a function's implementation if it cannot be determined. Not so with out-of-the-box tooling in strongly typed languages.
Rust doesn't guarantee desired function either. It doesn't mean that average rust program has the same probability to have segfault at runtime as a similar program written in C.
That particleDB link is VERY unconvincing. All the folks I know who wrote a TLA+ spec have said that it helped them discover bugs. Just that it was a massive pain to keep maintaining code and spec independently.
However, I am confused on why new PL is needed. Why not just improve lean and its libraries so that it becomes a standard big-software language like Go/Java/Rust ?
Replies (3)
Lean wouldn't be able to match Rust in performance without a fundamental restructure of its core calculus.
Replies (1)
Replies (2)
Lean is garbage collected and you don't control the layout of types in memory (and everything is boxed)
Replies (1)
Loosely related: the German TÜV now wants to certify AI systems https://www.tuev-verband.de/pressemitteilungen/tuev-organisa... (original in German, use your favorite translation tool)
I wonder whether such a certificate will be a future requirement for selling or running certain hosted software. It would be hilariously German when the certificate then mandates using formally verifiable programming languages.
They have said they wrote them, but I doubt it. The quote from the report:
"We found several incompatibilities or bugs involving static or dynamic type safety, or behaviors that would normally have been caught by static analysis of a query, such as referring to a nonexistent column. These issues occurred with a single server, single client, and no faults.
They failed to catch references to a nonexistent column with a formal proof? I doubt it, the more likely explanation they hadn't proven their code, they probably did something that allowed them to claim that they wrote TLA+ specs, and stopped at that.
Formal proof is a static analysis on steroids, if it can't catch bugs that can be caught by a static analysis then what the point of it?
The report doesn't answer how it happened (I presume) because of: "during our collaboration no TLA+ specification was available. It is unclear what properties might be proven, or whether they described ParticleDB as built.
Favourite line:
> Under normal operation, ParticleDB was slow, deadlocked, and crashed without warning.
If you have proofs attached to an actual implementation, things get much, much better.
For example, you can have type-checked distributed APIs (you can't omit a parameter for an HTTP request), you can have adherence to protocols checked at compile time (API calls sequences, etc), you can have many other things to be checked before any program run.
Oh. Look external stripe calls are hanging. (HALT problem)
The concurrency bugs SPIN and TLA+ find also eat tons of debugging time because they are hard to replicate. They're often called heisenbugs for how they're there and not there depending on the observer.
Static analyzers with low, false positives catch tedious or corner-case bugs developers often miss. That already tells you that any formal method that makes software immune to those big classes will also improve quality. SPARK Ada and Frama-C both do that.