Remix.run Logo
▲ hresvelgr 42 minutes ago

"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

▲vikramkr a few seconds ago | parent | next [-]

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

▲latentsea 2 minutes ago | parent | prev | next [-]

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.

▲FridgeSeal 6 minutes ago | parent | prev | next [-]

> 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.

▲ggm 9 minutes ago | parent | prev [-]

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.