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?
It is a gap, but the spec is often declarative, on what needs to be true, rather than imperative, about all the exact steps. Hence, less prone to error. You're right that it proves the protocol, but not necessarily the implementation.
A not-quite-there way to close the gap is that you can generate traces from the spec/proof, a sequence of states and events that must hold true. and then you can use that trace to replay back in tests, and if the implementation is correct, then it should mirror the trace.
The spec is far smaller than the implementation. For example take the TimSort case whose implementation in Java and Python had a bug that was there for years until someone tried to formally prove it correct.
I also think many valuable properties do not need specific domain judgement like never crashes, no out of bounds access, no data races etc.
A spec says "what" not the "how" you still need someone who understands the requirement but they don't have to get every single edge case right.
If a model writes both the implementation and the proof, the checker doesn't care who wrote them. Human review shrinks from "read all the generated code" to "read the spec".
> The spec is far smaller than the implementation.
That heavily depends on what problem you're trying to solve. The very example from TFA is quite illustrative:
contract ReplaceElement {
function replace(words: &mutable Slice<UInt64>, index: UInt64, value: UInt64) -> UInt64
requires index < words.len
ensures result == old(words[index])
and snapshot(words) == update(old(snapshot(words)), index, value)
terminates
effects { read(words), write(words) }
}
implementation InlineReplaceElement of ReplaceElement {
function replace(words: &mutable Slice<UInt64>, index: UInt64, value: UInt64) -> UInt64 {
let previous = words[index]
words[index] = value
previous
}
}
Or take, for instance, this spec in English prose: "given a predicate that returns true or false for each value, and a list of values, `filter` returns a new list that contains exactly the values in the original for which the predicate returned true". I guarantee you that turning this into the Truss contract would produce a significantly larger amount of code that the implementation that would consist of just the following 5 lines, modified accordingly:
result := []{}
for _, v := range list {
if predicate(v) { result = append(result, v) }
}
return result
And of course, please note that the spec I've given is defective: it doesn't say anything about the order of the elements in the resulting list, or the presence/absence of duplicates. Also, you probably will have to insist on the predicate being a pure or at least a repeatable (reproducible?) function — I don't know how you'll spec `filter` when it's given a non-idempotent predicate.
You can write a contract in natural language also and get more expressiveness, or do both. I think this language (formal contracts only) is a bit ambitious or maybe just not general yet? Regardless, you (humans and LLMs) can actually reason about contract correctness in terms of whether it is over or under specified, and if it is well grounded. It is also easier to make informal judgements (again, by humans or LLMs) about building the right thing compared to looking at implementation code. Lastly, when you do find bugs, you can reason about them at the contract level and figure out who to blame and what to fix more quickly (via contract improvements and then implementation alignment). So we are in a better place than before where we only have implementation code as a source of truth (aka vibe coding).
It helps substantially because it disentangles subjective and objective programming.
Like if you want a program that sorts a list that is a subjective goal because you could just as easily choose a shuffled list, or a different sorting, or any other sort of list ordering.
Once you've established what you want fulfilling that is an objective task.
Today's programming languages entangle subjectivity and objectivity together, and better decoupling them means we can automate the objective parts which dramatically reduces the programming left over for humans.
The product person should be able to work with the AI agent to make a high-level specification — after all, they will need to communicate that intent at some point.
I’m not sure where software engineers would take over, but given a sufficient spec, the system ought to be a direct translation of that spec. Ideally the spec itself should compile to realize system.
I would assume that the contract is much more concise than the implementation to satisfy that contract. Therefore, it's much easier for a human or AI to maintain.
It's a bit like writing and maintaining a declarative SQL query (new-style) vs writing a query planner (old-style programming).
Were already trusting LLMs to write code, which means it has to translate the human language to both system requirements and make sure the implementation fits those requirements.
Why not remove half the problem?
There is also something excellent formal code produces: modularity
>My question then is: Assuming everything I just said isn't nonsense, aren't we still in the same place as before?
You have a point, but the missing piece is the context size needed to iteratively write said contract.
Another angle to look at it -- we already do something like this (TDD) and it works, even if the classic argument says you can have bugs and gaps in your tests
Yes you can, but you can also have good and helpful tests. Also type systems while not being tests are from the same general area -- they express constraints which can be wrong.
Yet another angle to look at it -- it's easier to write a lot of declarative stateless code plus a small library solving general case of the statefullness than writing ton of stateful imperative code. From the correctness standpoint of course.
Add: contract being smaller than implementation is mentioned here, but it's a correlated metric to what I mean above. Even if the contract is longer, it could in theory allow refining different desired properties and their interactions in separate context windows. The contract being longer will also mean it specifies the behaviour in more details.
SDD is different from TDD though. Tests are just a parallel interpretation of the spec in SDD (parallel to the implementation being tested), while in TDD tests are considered a source of truth instead of the implementation (in SDD the spec is the source of truth).
Correct. Formal verification is indeed mostly vibes slopbros are currently swapping as a buzzword.
The hard part was never expressing the intent in a given language. The hard part is (and always has been) coming up with that intent in the first place.
The concept presented here is soemthing we do anyway in both OO and functional languages. Some syntaxes are more imperative and others are more declarative but nothing ever stops you from shipping behaviours or even tests as a package.
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.
This is not my experience at all. LLMs universal translation abilities let them pick up new languages really easily, especially if they borrow from existing languages and are consistent.
They pick it up but they don't write idiomatic code. As in they write it like they write the languages they are most familiar with. Trying to teach them to use the special features of your language (the entire point of writing it) is not trivial.
Same experience here. I've been building LLMLL, another language no model was trained on. We built small fixtures meant to bait a subtly wrong implementation past its contract and ran them through Claude Opus, gpt-5.5 and Gemini. Across 69 attempts there were zero wrong fills.
Sounds like we overlap a lot. LLMLL has requires/ensures contracts too, and the SMT check you have planned for @verify already runs there over a decidable fragment. Anything outside that fragment is marked asserted or tested, not proven. It compiles to Haskell today, with WASM/WASI on the roadmap as the sandbox. Happy to compare notes.
I don’t see a need for a new language when we already have Lean - which is a general purpose language that is mostly Haskell but strict and dependently typed (which is far easier to reason about than - for example - all the wizardry behind Servant).
Where it’s not fast enough there is Rust with Aeneas.
That's a great talk, and it has a resonant quote: "If you let your LLM us a general purpose language, your LLM has to solve all those hard problems instead. Good languages make the illegal impossible."
I think there's some truth here: linters and compilers for general purpose languages are only so powerful, and LLMs will always be tempted to use patterns they've seen before when they're knee-deep in a language they think they understand how to use for your problem. Restricting them to think about problems from first principles in languages with clear and enforced guidelines about data sharing, ownership, traceability, etc. can be very powerful.
Here someone else who tried to write a coding agent optimized programming language, but I asked it to optimize for cost. Using less tokens is an obvious one but while working on it the actual engineer (LLM) decided that saving on tokens would be marginal savings compared to being able to write the same quality code by a cheaper model. But it never found out how.
After a couple of hours seeing benchmarks in which it lost from Python on pretty much everything, it told me to give up. I did.
Maybe the answer isn't to create a new language for AI, but add to Python the things that Claude tells me makes other languages better for some things, like type safety and a try compilation step to find errors way ahead of runtime.
(Or did I just describe something that has been done eleven times already?)
`ty` and `mypy` are efforts to add this to python. It's fairly inconsistent because of the vast library of python code that doesn't use it, much like early typescript. Unlike typescript, however, there's not the huge push right now to adopt because python coders are happy where they are.
+1. You cannot teach AI a new programming language with prompts. In order to be efficient the language has to be in its "brain", i.e., AI's neural network has to be trained on large number of samples.
> You cannot teach AI a new programming language with prompts
Incorrect. I built my own programming language [0] and agents just look up the docs and write it with great success. It helps to have static linting/analysis of course, but they always do just fine writing Rad despite it being very small.
They already have been trained, on other languages that provide similar-enough constructs to translate over to the new language. Same principle as how a C++ developer can write Rust after looking at a few syntax examples.
For instance:
contract ReplaceElement {
function replace(words: &mutable Slice<UInt64>, index: UInt64, value: UInt64) -> UInt64
requires index < words.len
ensures result == old(words[index])
and snapshot(words) == update(old(snapshot(words)), index, value)
terminates
effects { read(words), write(words) }
}
This is _extremely_ similar to JS/Rust/Java style syntax mixed with common forms from general ALGOL descendant languages. LLMs should have no trouble writing this whatsoever.
If any such language gets adoption or even seems like a promising direction, I think in this day and age it should be trivial for the labs to RLVR it into the model with synthetic data.
Edit: if you use local models you could probably fine-tune or do a LoRA for it yourself.
Incorrect. Models can actually adapt to new syntax quite easily, even with zero training material. Of course that does depend on how truly novel your syntax && constructs are, but generally speaking if you don't deviate too-too far from conventional wisdom you should be fine. My language is quite exotic in fact and frontier LLMs have no trouble writing it, as long as you supply a .bnf file.
They do fine even with completely novel syntax. I built a programming language designed to be hard for LLMs[1] with syntax that no other programming language uses and most can get the hang of it pretty quickly.
It's funny: if we were talking about programming languages generally, I would pop in to say something about how syntax really doesn't matter and a language having "exotic" syntax is almost entirely irrelevant. But since LLMs only interact with syntax, it's interesting that they are seemingly able to adapt to novel syntax fairly well.
Dumb question maybe (IANAAIPowerUser)- this new teaching will now always occupy some part of the working context right?
As a result of that
1) Do you have smaller usable context?
2) Does the model over-use the new teachings?
If you wanted Eiffel Contracts why didn't you go directly to the source?
Eiffel Software still exist has proof verifier with autoproof and many tools that make working with high quality code very easy.
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.
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.
it's interesting you mentioned Dafny, as after taking a look myself, I see the method specification syntax that Truss uses, has keywords like ensures and requires which is straight up from Dafny, which itself is a Microsoft Research language made by a person who worked on SpecSharp (basically contracts for .NET), which itself took the `ensure` and `require` keywords from Eiffel.
I couldn't find a connection between Truss's author and Microsoft, so I do wonder if he maybe got an LLM to design the syntax, which then included prior art from Microsoft etc.
That paper is benchmarking esolangs, which are meant to demonstrate concepts, not to be usable —- some of them try to be as unusable as possible. So it’s the pathological case.
No, esolangs are convoluted because they require entire paradigm shifts of thinking. All mainstream languages are more or less the same, if-then-else, just in different ways, match statements, gotos, monads, whatever. Even if it might not be as strong in a less common one, it can still get a general idea and map it's abstract knowledge on to the new language. I've even seen some complains from people writing in Clojure that "the LLM just defaults back into Python-isms", which doesn't mean that the LLM is bad at the language, just not optimized to it's strengths, like a skilled programmer who's just learning the language. Esolangs require working in entire state machines, it's completely foreign to intellect in general, it's like seeing the world in Game of Life cells, it's just way too much cognitive overhead, for man or machine. That's why some esolangs are so complicated we have to engineer a mathematical solution just to write a simple program in them. You don't need to do that for a mainstream, human-readable language. That's why they're esoteric. Hidden knowledge.
That's a valid hypothesis, but according the paper apparently they are bothered by writing these languages to some degree compared to others, so is that due to lack of training data or lack of intrinsic unusability?
My hypothesis is that if LLMs are intelligent, they should benefit from usability the same way humans do. Maybe not to the same degree, but more usable languages for humans should be more usable for LLMs compared to pathological unusability. Perhaps you can get around unusability with enough data, or maybe you can get away with fewer training data by being more usable.
Some of these esolanguages might be pathological for LLMs because they require them to engage in thinking they're actually structurally bad at -- Befunge-98 executes in two spatial dimensions, while LLMs process a linear stream of tokens; Whitespace encodes instructions entirely through spaces, tabs, and newlines, potentially confounding tokenizers; Shakespeare uses theatrical dialogue but resembles neither conventional code nor authentic dialogue; Brainfuck effectively requires the LLM to simulate execution while generating code.
So the really interesting question to me at this point is: how much can you change Python or another language that is mainstream before you see the kind of dropoff performance you see with the esolangs? I dunno.
There, they let the LLM write Python code which then wrote the esocode, which at least shows the LLMs understand the assignment. But that doesn't really resolve the question we have.
Assuming the human is even doing the hype. I think if the author isn’t actively participating in the discussion they tried so hard to get going, we can (or should) just assume they’re a bot.
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??
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?
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?
No. Tests can only uncover the presence of errors, never their absence.
Ideally, pre conditions, post conditions, and invariants are part of every function. Nothing new really. Languages like Eiffel have been doing this for decades, but everything old is new again, I guess.
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?
It is a gap, but the spec is often declarative, on what needs to be true, rather than imperative, about all the exact steps. Hence, less prone to error. You're right that it proves the protocol, but not necessarily the implementation.
A not-quite-there way to close the gap is that you can generate traces from the spec/proof, a sequence of states and events that must hold true. and then you can use that trace to replay back in tests, and if the implementation is correct, then it should mirror the trace.
> spec is often declarative
ppl always come with weird workarounds to put in loops and if conditions and then throw it all away to use a general purpose programming languge
Maybe try not doing that?
The spec is far smaller than the implementation. For example take the TimSort case whose implementation in Java and Python had a bug that was there for years until someone tried to formally prove it correct. I also think many valuable properties do not need specific domain judgement like never crashes, no out of bounds access, no data races etc. A spec says "what" not the "how" you still need someone who understands the requirement but they don't have to get every single edge case right. If a model writes both the implementation and the proof, the checker doesn't care who wrote them. Human review shrinks from "read all the generated code" to "read the spec".
> The spec is far smaller than the implementation.
That heavily depends on what problem you're trying to solve. The very example from TFA is quite illustrative:
Or take, for instance, this spec in English prose: "given a predicate that returns true or false for each value, and a list of values, `filter` returns a new list that contains exactly the values in the original for which the predicate returned true". I guarantee you that turning this into the Truss contract would produce a significantly larger amount of code that the implementation that would consist of just the following 5 lines, modified accordingly: And of course, please note that the spec I've given is defective: it doesn't say anything about the order of the elements in the resulting list, or the presence/absence of duplicates. Also, you probably will have to insist on the predicate being a pure or at least a repeatable (reproducible?) function — I don't know how you'll spec `filter` when it's given a non-idempotent predicate.You can write a contract in natural language also and get more expressiveness, or do both. I think this language (formal contracts only) is a bit ambitious or maybe just not general yet? Regardless, you (humans and LLMs) can actually reason about contract correctness in terms of whether it is over or under specified, and if it is well grounded. It is also easier to make informal judgements (again, by humans or LLMs) about building the right thing compared to looking at implementation code. Lastly, when you do find bugs, you can reason about them at the contract level and figure out who to blame and what to fix more quickly (via contract improvements and then implementation alignment). So we are in a better place than before where we only have implementation code as a source of truth (aka vibe coding).
It helps substantially because it disentangles subjective and objective programming.
Like if you want a program that sorts a list that is a subjective goal because you could just as easily choose a shuffled list, or a different sorting, or any other sort of list ordering.
Once you've established what you want fulfilling that is an objective task.
Today's programming languages entangle subjectivity and objectivity together, and better decoupling them means we can automate the objective parts which dramatically reduces the programming left over for humans.
The product person should be able to work with the AI agent to make a high-level specification — after all, they will need to communicate that intent at some point.
I’m not sure where software engineers would take over, but given a sufficient spec, the system ought to be a direct translation of that spec. Ideally the spec itself should compile to realize system.
Isn't code that works a sufficient spec? By works I mean, meets the stakeholder requirements as they understand them.
I would assume that the contract is much more concise than the implementation to satisfy that contract. Therefore, it's much easier for a human or AI to maintain.
It's a bit like writing and maintaining a declarative SQL query (new-style) vs writing a query planner (old-style programming).
Were already trusting LLMs to write code, which means it has to translate the human language to both system requirements and make sure the implementation fits those requirements. Why not remove half the problem?
There is also something excellent formal code produces: modularity
>My question then is: Assuming everything I just said isn't nonsense, aren't we still in the same place as before?
You have a point, but the missing piece is the context size needed to iteratively write said contract.
Another angle to look at it -- we already do something like this (TDD) and it works, even if the classic argument says you can have bugs and gaps in your tests Yes you can, but you can also have good and helpful tests. Also type systems while not being tests are from the same general area -- they express constraints which can be wrong.
Yet another angle to look at it -- it's easier to write a lot of declarative stateless code plus a small library solving general case of the statefullness than writing ton of stateful imperative code. From the correctness standpoint of course.
Add: contract being smaller than implementation is mentioned here, but it's a correlated metric to what I mean above. Even if the contract is longer, it could in theory allow refining different desired properties and their interactions in separate context windows. The contract being longer will also mean it specifies the behaviour in more details.
SDD is different from TDD though. Tests are just a parallel interpretation of the spec in SDD (parallel to the implementation being tested), while in TDD tests are considered a source of truth instead of the implementation (in SDD the spec is the source of truth).
Correct. Formal verification is indeed mostly vibes slopbros are currently swapping as a buzzword.
The hard part was never expressing the intent in a given language. The hard part is (and always has been) coming up with that intent in the first place.
The concept presented here is soemthing we do anyway in both OO and functional languages. Some syntaxes are more imperative and others are more declarative but nothing ever stops you from shipping behaviours or even tests as a package.
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.
This is not my experience at all. LLMs universal translation abilities let them pick up new languages really easily, especially if they borrow from existing languages and are consistent.
I've been building a new programming language, Zena [1], for a year and modern Claude and Gemini have absolutely no problem generating the code with about a 300-line skill: https://github.com/elematic/zena/blob/main/skills/zena/SKILL...
(I also happen to be adding contracts and formal verification for gen AI, maybe similar to Truss, but that targets Wasm for sandboxing).
[1]: https://zena-lang.dev/
They pick it up but they don't write idiomatic code. As in they write it like they write the languages they are most familiar with. Trying to teach them to use the special features of your language (the entire point of writing it) is not trivial.
Same experience here. I've been building LLMLL, another language no model was trained on. We built small fixtures meant to bait a subtly wrong implementation past its contract and ran them through Claude Opus, gpt-5.5 and Gemini. Across 69 attempts there were zero wrong fills.
Sounds like we overlap a lot. LLMLL has requires/ensures contracts too, and the SMT check you have planned for @verify already runs there over a decidable fragment. Anything outside that fragment is marked asserted or tested, not proven. It compiles to Haskell today, with WASM/WASI on the roadmap as the sandbox. Happy to compare notes.
I don’t see a need for a new language when we already have Lean - which is a general purpose language that is mostly Haskell but strict and dependently typed (which is far easier to reason about than - for example - all the wizardry behind Servant).
Where it’s not fast enough there is Rust with Aeneas.
I saw a talk this year from one of the Pony Lang folks talking about this exact problem and how they essentially taught Pony to Claude.
https://carolina.codes/speakers/2026/redvers-davies
It was really interesting. Pony is also deeply underrated.
That's a great talk, and it has a resonant quote: "If you let your LLM us a general purpose language, your LLM has to solve all those hard problems instead. Good languages make the illegal impossible."
I think there's some truth here: linters and compilers for general purpose languages are only so powerful, and LLMs will always be tempted to use patterns they've seen before when they're knee-deep in a language they think they understand how to use for your problem. Restricting them to think about problems from first principles in languages with clear and enforced guidelines about data sharing, ownership, traceability, etc. can be very powerful.
Direct link to talk: https://www.youtube.com/watch?v=oU5sV1ljTzs
raise hand
Here someone else who tried to write a coding agent optimized programming language, but I asked it to optimize for cost. Using less tokens is an obvious one but while working on it the actual engineer (LLM) decided that saving on tokens would be marginal savings compared to being able to write the same quality code by a cheaper model. But it never found out how.
After a couple of hours seeing benchmarks in which it lost from Python on pretty much everything, it told me to give up. I did.
Maybe the answer isn't to create a new language for AI, but add to Python the things that Claude tells me makes other languages better for some things, like type safety and a try compilation step to find errors way ahead of runtime.
(Or did I just describe something that has been done eleven times already?)
`ty` and `mypy` are efforts to add this to python. It's fairly inconsistent because of the vast library of python code that doesn't use it, much like early typescript. Unlike typescript, however, there's not the huge push right now to adopt because python coders are happy where they are.
Not hard to fine tune a model though on a specific new language.... even a small one can be pretty effective when fine tuned.
+1. You cannot teach AI a new programming language with prompts. In order to be efficient the language has to be in its "brain", i.e., AI's neural network has to be trained on large number of samples.
> You cannot teach AI a new programming language with prompts
Incorrect. I built my own programming language [0] and agents just look up the docs and write it with great success. It helps to have static linting/analysis of course, but they always do just fine writing Rad despite it being very small.
[0] https://github.com/amterp/rad
They already have been trained, on other languages that provide similar-enough constructs to translate over to the new language. Same principle as how a C++ developer can write Rust after looking at a few syntax examples.
For instance:
This is _extremely_ similar to JS/Rust/Java style syntax mixed with common forms from general ALGOL descendant languages. LLMs should have no trouble writing this whatsoever.you don't want anything thats extremely close; you want something that is dissimilar and users very cogent keywords.
Similarity shits up context very quickly.
If any such language gets adoption or even seems like a promising direction, I think in this day and age it should be trivial for the labs to RLVR it into the model with synthetic data.
Edit: if you use local models you could probably fine-tune or do a LoRA for it yourself.
Incorrect. Models can actually adapt to new syntax quite easily, even with zero training material. Of course that does depend on how truly novel your syntax && constructs are, but generally speaking if you don't deviate too-too far from conventional wisdom you should be fine. My language is quite exotic in fact and frontier LLMs have no trouble writing it, as long as you supply a .bnf file.
They do fine even with completely novel syntax. I built a programming language designed to be hard for LLMs[1] with syntax that no other programming language uses and most can get the hang of it pretty quickly.
1 - https://killswitch-lang.org
It's funny: if we were talking about programming languages generally, I would pop in to say something about how syntax really doesn't matter and a language having "exotic" syntax is almost entirely irrelevant. But since LLMs only interact with syntax, it's interesting that they are seemingly able to adapt to novel syntax fairly well.
Dumb question maybe (IANAAIPowerUser)- this new teaching will now always occupy some part of the working context right? As a result of that 1) Do you have smaller usable context? 2) Does the model over-use the new teachings?
Try harder.
If you wanted Eiffel Contracts why didn't you go directly to the source? Eiffel Software still exist has proof verifier with autoproof and many tools that make working with high quality code very easy.
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.
Well your belief is entirely wrong, because LLM's have shown time and again that they generalize to new languages easily.
Maybe I am finally getting old but I remember `truss` as a sort of `strace` alternative.
MocOS still ships `dtruss`, but it’s hobbled compared to Linux’s `strace`.
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.
it's interesting you mentioned Dafny, as after taking a look myself, I see the method specification syntax that Truss uses, has keywords like ensures and requires which is straight up from Dafny, which itself is a Microsoft Research language made by a person who worked on SpecSharp (basically contracts for .NET), which itself took the `ensure` and `require` keywords from Eiffel.
I couldn't find a connection between Truss's author and Microsoft, so I do wonder if he maybe got an LLM to design the syntax, which then included prior art from Microsoft etc.
How does this differ from just plain Lean?
Declaring the contract, provider etc. in quasi-Rust? No thanks. I think there should be better ways to do that.
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/
That paper is benchmarking esolangs, which are meant to demonstrate concepts, not to be usable —- some of them try to be as unusable as possible. So it’s the pathological case.
But that's usability from a human perspective; an LLM shouldn't be bothered by it.
No, esolangs are convoluted because they require entire paradigm shifts of thinking. All mainstream languages are more or less the same, if-then-else, just in different ways, match statements, gotos, monads, whatever. Even if it might not be as strong in a less common one, it can still get a general idea and map it's abstract knowledge on to the new language. I've even seen some complains from people writing in Clojure that "the LLM just defaults back into Python-isms", which doesn't mean that the LLM is bad at the language, just not optimized to it's strengths, like a skilled programmer who's just learning the language. Esolangs require working in entire state machines, it's completely foreign to intellect in general, it's like seeing the world in Game of Life cells, it's just way too much cognitive overhead, for man or machine. That's why some esolangs are so complicated we have to engineer a mathematical solution just to write a simple program in them. You don't need to do that for a mainstream, human-readable language. That's why they're esoteric. Hidden knowledge.
That's a valid hypothesis, but according the paper apparently they are bothered by writing these languages to some degree compared to others, so is that due to lack of training data or lack of intrinsic unusability?
My hypothesis is that if LLMs are intelligent, they should benefit from usability the same way humans do. Maybe not to the same degree, but more usable languages for humans should be more usable for LLMs compared to pathological unusability. Perhaps you can get around unusability with enough data, or maybe you can get away with fewer training data by being more usable.
Some of these esolanguages might be pathological for LLMs because they require them to engage in thinking they're actually structurally bad at -- Befunge-98 executes in two spatial dimensions, while LLMs process a linear stream of tokens; Whitespace encodes instructions entirely through spaces, tabs, and newlines, potentially confounding tokenizers; Shakespeare uses theatrical dialogue but resembles neither conventional code nor authentic dialogue; Brainfuck effectively requires the LLM to simulate execution while generating code.
So the really interesting question to me at this point is: how much can you change Python or another language that is mainstream before you see the kind of dropoff performance you see with the esolangs? I dunno.
The authors of that study you linked did a followup: https://esolang-metaprogramming.vercel.app
There, they let the LLM write Python code which then wrote the esocode, which at least shows the LLMs understand the assignment. But that doesn't really resolve the question we have.
I've been beating this drum for some time, this is the way forward
what if we could rewrite friendfeed with truss?
This doesn't work without a formal spec for the target ISA.
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.
Assuming the human is even doing the hype. I think if the author isn’t actively participating in the discussion they tried so hard to get going, we can (or should) just assume they’re a bot.
Named for having the lifespan of an iceberg lettuce?
Great name for their test suite!
Each program takes 49 days to run, and then never runs again having destroyed the computer that it was running on.
Had to actually read the comments to find this after Ctrl-F "liz", Ctrl-F "brit" failed me.
There's got be a bad with cache joke in there somewhere.
Named for how you have to respond to people at work questioning wtf you’re doing. “We got this bro. Truss”
> Traditional programming language: Optimize for human editing, Optimize for convenience, Minimize human authoring time
Nothing is better than a fresh load of false dichotomy.
Lovely idea, but I reckon the lettuce on my shelf will probably outlast this language!
> optimized for agent-written software
Benchmarks or it wasn't optimized.
I followed the link, poked around, and couldn't find any benchmarks results.
If it ain't gonna formal verify, it ain't gonna rhyme (just as demonstrated)
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??
Endless comedy for Brits in the naming here.
Can it do maths?
>Truss
How quickly can it unseat the UK government?
bit of a bad choice of name (if your in the UK)
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?
Its hard to hate a project more than this to be honest. What an anti human way to think.
Why does that bother you? Its a programming language for an AI, of course it's not for humans.
Agreed
LLMs are a bet to the tune of trillions of dollars against humans. The bet seems to be paying off.
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?
No. Tests can only uncover the presence of errors, never their absence. Ideally, pre conditions, post conditions, and invariants are part of every function. Nothing new really. Languages like Eiffel have been doing this for decades, but everything old is new again, I guess.