Bret Taylor's Truss asks AI agents to prove their code is correct
Truss: A programming language optimized for agent-written software
Truss is a prototype programming language built on the premise that AI agents, not humans, will write most software. Instead of optimizing for authoring convenience, it optimizes for verification: packages are built around contracts with formally proven behaviors, and providers ship proofs that they satisfy those contracts. The compiler then reuses those proofs, so formal verification scales across large codebases without redoing work. Taylor, who created the project, argues most pre-AI software will be rewritten.
I think we will probably rewrite most software written before AI because that software is imperfect, insecure, and slow.
- thesecretsquad
I'm not half as smart as most of the people on HN and I don't know much about formal verification, so maybe this is a dumb question....
My understanding of this is: You write a "contract" that defines the specification for some functionality, including inputs, outputs, preconditions, post-conditions, etc. and the contract can be formally verified by some proof checker that says it's logically consistent. Then you build the implementation and the implementation can be proven to abide by the contract (or not).
But somebody has to write the contract (either a person or AI). If the contact specifies behavior that is logically consistent as far as a proof checker is concerned, but the behavior is defined incorrectly, you could have a situation where "you built the thing right", but "you didn't build the right thing".
So someone still needs to make sure the contracts are specifying the correct behavior. Once you know you have, then I suppose the formal verification is good because everybody (people and AI) know that it guarantees its behavior.
My question then is: Assuming everything I just said isn't nonsense, aren't we still in the same place as before? Someone needs to know how to specify (and program) the right behavior?
- grahamlee
Difficulty: no existing model is trained on Truss. They have been trained on examples of design by contract in other languages (Ada, Eiffel, Java etc) and would do a better job with those and with contract-enforcement rules. Or even with grammar-constrained output and those languages.
Source: I also tried writing an agent-optimized language (for concision and adaptability, not correctness), then I measured.
- alexanderabakah
Great idea, but I believe AI you can't make an ML model efficient just through prompts. You must train the model with the language and vast samples of code written in that language. Even with python which is ubiquitous, something models struggle with optimization or smart algorithms it hasn't seen during training.
I guess the best way will be to improve on existing languages by adding the contracts and verification methods on top of them.
- sureglymop
Maybe I am finally getting old but I remember `truss` as a sort of `strace` alternative.
- abeppu
Proofs about program correctness are great but I don't think this even really attempts to argue why a new language is needed or what this does better than other systems in the space. The only other language mentioned in this project page is Rust as "a small step", but doesn't mention F*, Dafny, Idris, Verus, CakeML etc. I think basically all of these have some greater burdens for authors which previously made them realistic for only some projects, but now that we can have agents deal with those headaches, maybe they should expect to see broader use.