hn.today

Truss: A programming language optimized for agent-written software

github.com130 points104 comments
Screenshot of Truss: A programming language optimized for agent-written software

Truss is a prototype programming language built around the idea that AI agents, rather than people, will increasingly write software. Instead of prioritizing easy editing and quick authoring, it asks agents to spend more effort proving programs correct, secure, and efficient - an upfront cost intended to yield lasting reliability. Its central unit is a contract, which specifies a function’s behavior, permitted memory access, and allowed state changes. Implementations, called providers, must include proofs that they meet those guarantees. For example, a contract for replacing an item in a slice can state that the index is valid, the returned value is the one overwritten, and no other elements change.

This design aims to make verification practical across large codebases: clients reason from a contract rather than re-proving every implementation, while the compiler checks provider evidence and guarantees that compilation and linking preserve the promised behavior. The package author bears much of the proof-generation cost, and dependent programs can validate the published evidence more quickly. The language’s examples cover guarantees for sorting, cryptographic hashes, HTTP parsing, ZIP extraction, JSON escapes, socket events, checksums, and byte buffers. Truss also includes tools to resolve dependencies, check contracts and proofs, build and run programs, and test packages. Its ambition is to enable agents to produce software with stronger correctness, security, and performance guarantees than typical existing systems, while serving as a starting point for discussion about future programming platforms.

Read on github.com104 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

Show HN: Rust Commander

Show HN: Rust Commander

Rust Commander is a Rust terminal file manager modeled on Midnight Commander, with dual-pane navigation, a persistent shell, archive and remote browsing, and background file operations. Version 0.3.1 adds file-change alerts, viewer copy controls, customizable skins, and faster SFTP previews and copying. (github.com)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.