logoalt Hacker News

Animats • today at 8:01 PM • 0 replies • view on HN

There are a reasonable number of candidate programming languages. That problem has been addressed before. The big problem now is specification. If the specification is too formal, it's too long and too hard for humans to read. We need something in between. There aren't many candidates. There was UML, but that was something of a dud.

Consider a specification at roughly the level that Rust crates are documented. Rust crate documents contain all the exported types and functions, along with a textual description of what each does. The document should provide enough information to use the crate without looking inside it. That's a widely accepted form of documentation.

Rust crate documents are usually created from the code. But consider going the other way. Write the crate documentation first, and let an LLM implement it from there. With an LLM creating the code and reading the documentation, the LLM can create formal contract constraints for proof purposes. Constraints visible at the API level can be re-exported to the document.

That seems within reach of current LLM technology. Is it? It's worth trying. Take some low-level crate documentation for existing crates and see what an LLM with a moderately large budget can do with it. Try to create a drop-in replacement.

Doing this on low-level Rust crates would be a useful exercise. Try to formalize the bottom of the stack.