logoalt Hacker News

Truss: A programming language optimized for agent-written software

80 points • by sram1337 • today at 6:51 PM • 55 comments • view on HN

Comments

thesecretsquad • today at 8:59 PM

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?

➕ show 5 replies
grahamlee • today at 7:11 PM

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.

➕ show 6 replies
alexanderabakah • today at 8:32 PM

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 • today at 8:04 PM

Maybe I am finally getting old but I remember `truss` as a sort of `strace` alternative.

➕ show 1 reply
npalli • today at 10:09 PM

Declaring the contract, provider etc. in quasi-Rust? No thanks. I think there should be better ways to do that.

abeppu • today at 8:19 PM

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.

➕ show 1 reply
wavemode • today at 9:08 PM

How does this differ from just plain Lean?

irdc • today at 9:24 PM

Considering LLM performance tends to depend on how well a particular language was represented in its training set[0], is this even going to work?

0. https://esolang-bench.vercel.app/

➕ show 1 reply
Kuyawa • today at 7:56 PM

I've been beating this drum for some time, this is the way forward

mathisfun123 • today at 9:16 PM

This doesn't work without a formal spec for the target ISA.

deathhawk • today at 8:44 PM

[dead]

rahen • today at 8:36 PM

Original commit two days ago with +663,934 lines of Rust. Eight commits. Already reposted six times on HN since then.

I'm not sure I want to bother with something where the only human involvement was generating the hype.

➕ show 1 reply
pwdisswordfishq • today at 7:16 PM

Named for having the lifespan of an iceberg lettuce?

➕ show 5 replies
meitham • today at 9:16 PM

Lovely idea, but I reckon the lettuce on my shelf will probably outlast this language!

ivanjermakov • today at 9:50 PM

> Traditional programming language: Optimize for human editing, Optimize for convenience, Minimize human authoring time

Nothing is better than a fresh load of false dichotomy.

joshheitzman • today at 9:43 PM

> optimized for agent-written software

Benchmarks or it wasn't optimized.

I followed the link, poked around, and couldn't find any benchmarks results.

pmkary • today at 9:40 PM

If it ain't gonna formal verify, it ain't gonna rhyme (just as demonstrated)

semiinfinitely • today at 8:47 PM

so the idea is to invent a new programming language that agents have not been trained on for trillions of tokens, and somehow they're supposed to be better at it than all the languages they have been trained on for trillions of tokens??

IshKebab • today at 8:50 PM

The trouble is: a) if you want formally verified software you can write it in Lean - AI is extremely good at that, and b) why should I use your 3 day old vibe coded language when I can just as easily make one myself?

acedTrex • today at 7:35 PM

Its hard to hate a project more than this to be honest. What an anti human way to think.

➕ show 2 replies
ordesign • today at 9:13 PM

[dead]

theturtle • today at 8:29 PM

[dead]

Incipient • today at 8:51 PM

We've had a few similar formally verifiable, contract based, provable languages appear recently.

Isn't that whole concept covered by a test suite? The language can't know what you want to do, so you have to write a contact/rule/etc for it - in the same way you'd write a test?

➕ show 1 reply