I have been arguing for a while that very strict languages with a heavy type system are ideal for agent coding.
The stricter the language, the harder it is for the LLM to produce nonsense, at least if it can get compilation errors and run tests. And the easier it is to validate that the output is correct, because the types already tell a lot of the story.
A language with dependent types, linear types, etc... would be ideal, but alas...
At the moment Rust is the sweet spot. Fairly popular (and hence known to LLMs and with a fairly good ecosystem), great error messages to guide resolution of problems, stricter type system and more compile-time guarantess than almost all of the other semi-popular languages...
Now Rust isn't trivial to write, for both humans and LLMs, and the output was pretty bad for a long time.
But with the ability to run `cargo check` and execute tests, even the current first iteration of agents is really quite good at iterating until it gets a working result.
Types only go far. Most of the semantics of a function's behavior is in its name, documentation and tests.
I think it is time to invent a unifying framework for Types, Tests and Evals: https://nilesh.trivedi.link/thoughts/we-need-a-formal-theory...