Why don't people use formal methods? (2019)
51–60 of 121 posts
Re: Why don't people use formal methods? (2019)
#52My 2c I don't understand any of the material I've read describing them. What I do understand makes them sound like it will be a load of work for questionable benefits. If I end up writing safety-critical code. (Aerospace firmware, big robots etc), I will get over this hump and learn them. If not, I am not yet compelled; rather intimidated. Maybe this is like Quaternions, that are actually very easy and useful, but su…
IANA formal methods guy, but my understanding is: yes, you're shifting the correctness burden from the code to the spec.
So why is that better? Because the spec is much shorter and more focused -- it strips out all of the implementation details.
It's bad to say "you have to trust this 100,000 line program." It's much better to say "you have to trust this 100 line spec, and the code that verifies it."
Re: Why don't people use formal methods? (2019)
#53Earlier quoted context omitted.
Very cool project and good finds. What do you see as the end state for your project - do you think pg has a path to upstream, or would this be a fork? Without knowing anything about the pg team, I would assume they would be hesitant to even consider an under the hood switch, just from a risk management perspective, regardless of test coverage and formal verification. But I could be wrong.
Thank you for the kind words! My goal is to build the best database possible. I'm trying to imagine what Postgres would be like if it were built today. I've been able to make a bunch of big architectural changes that the Postgres team has been talking about but hasn't yet made. For example, threads instead of processes and a vectorized executor. I think everyone would agree the types of changes I'm making are good on…
Re: Why don't people use formal methods? (2019)
#54My 2c I don't understand any of the material I've read describing them. What I do understand makes them sound like it will be a load of work for questionable benefits. If I end up writing safety-critical code. (Aerospace firmware, big robots etc), I will get over this hump and learn them. If not, I am not yet compelled; rather intimidated. Maybe this is like Quaternions, that are actually very easy and useful, but su…
> Does formal verification lead to a strange-loop style or "It's verification all the way down" scenario, where you are shifting the correctness from the original code to the verification? Then must verify the verification ad-infinitum? IANA formal methods guy, but my understanding is: yes, you're shifting the correctness burden from the code to the spec. So why is that better? Because the spec is much shorter and mo…
Re: Why don't people use formal methods? (2019)
#55Earlier quoted context omitted.
One of my favorite quotes on this topic is: "Type systems are just the parts of formal verification we've figured out how to make fast."
Thankfully this is no longer strictly true. So, I think the quote needs a slight adjustment, "Type systems and $THING are just ...", but $THING is not very well defined yet. Between "linters", and other relatively fast AST-based rule enforcers, some of which looking at higher order behavior, I think we now have an amalgamation of formally verified concepts that we can consider fast enough and sufficient exercised in…
Re: Why don't people use formal methods? (2019)
#56Because there is almost never a business need? Most programs don't need to be rigorously perfect. If they did, LLMs wouldn't be as popular as they are right now. If you're dealing with medical equipment or space flight, maybe there's a need. But usually the goal is to make errors _inexpensive_ to find and fix, not theoretically impossible.
That doesn't quite match my professional experience, though - there are so many companies building databases, message queues, filesystems, and similar infrastructure. Sometimes they're internal projects, and sometimes they're commercial products. I've always felt that those systems would benefit from formal methods, since they're usually trying to provide strong guarantees to the application code on top.
Re: Why don't people use formal methods? (2019)
#571. All our code changes too much, we wouldn't be able to formalize it before it needed to change.
2. We already did this where we could, you just don't see it.
I didn't get the job and remain very skeptical on both answers. I think they just didn't have enough power internally to change the move fast and break everything culture for the better.
Re: Why don't people use formal methods? (2019)
#58I recently came across a use case where formal methods were incredibly helpful. I've been rewriting Postgres in Rust and am currently focusing on correctness. The biggest challenge is that there's so much surface area to cover. Postgres has over 3000 user-facing functions, ranging from regular expression matching to JSON iteration to computing the gamma function. About half of these functions are simple pure function…
Re: Why don't people use formal methods? (2019)
#59To me, "this returns sorted lists" illustrates the crux. You may know exactly what you want, and you may have a reasonably fast and cheap way to verify your code against a formal specification. But the formal specification needs to come from somewhere and for any non-trivial program its complexity is going to be in the same order of magnitude as the code implementing it. So we are back to writing "code" (which is wha…
Re: Why don't people use formal methods? (2019)
#60I would love to see an example of a proof for something like a text editor. How can people be expected to do this when the examples are always trivial toys, like array sorting? Show me a formal proof of something that in the trenches programmers can copy from. A proof of a basic todo list or something like that.