AI Today

⌨️ Do types help AI coding agents? Evil Martians finds no advantage in benchmarks or its own runs

· 5 min

Cover illustration of the Evil Martians study on type errors and coding agents

In brief


🧪 Static types make AI coding agents better: that is a common assumption, voiced for example in GitHub's Octoverse report. Developer firm [Evil Martians](https://evilmartians.com/) tested it against data and reported on 24 November: in public benchmarks of real tasks in ten languages, agents solve typed and dynamic tasks equally often at the same difficulty, about 65 percent. ⏱️ In 24 of its own runs on Ruby on Rails and Rust, fixing type errors cost the agents under 1 percent of their time. No task failed because of a type error; every failure was about logic and behaviour. When agents were told to use a type checker on a Rails app, they did, but solved no more tasks: 57 to 61 percent against 58 percent. The type tools took 20 to 28 percent of their time. 🔬 The firm, which builds Rails benchmarks and sells agent evaluations, publishes all runs and scripts. A study by Shriram Krishnamurthi and Matthew Flatt found, by contrast, that a type system helps agents repair planted errors more than test results alone.


## Where the assumption comes from

📚 The post by Irina Nazarova quotes the voices recommending types for agents: GitHub's Octoverse 2025 credits AI with pushing TypeScript to number one because type systems catch language-model errors. Thomas Wolf of Hugging Face expects AI to favour strongly typed languages; Simon Willison and Matt Pocock have said similar things. The often-quoted figure that 94 percent of compile errors in AI code are type errors comes from a PLDI 2025 paper on type-constrained code generation. It says which errors break a typed build, not whether agents finish more tasks with types. The only head-to-head test the authors found comes from Ruby developer Yusuke Endoh: in 600 Claude Code runs, statically typed languages were 1.4 to 2.6 times slower and more expensive, though on a small task.

## Ten languages at the same difficulty

📊 For larger tasks, Evil Martians analysed SWE-bench Multilingual, 300 real issues from 41 repositories solved by 13 models, plus SWE-bench Verified for Python. Raw numbers favour dynamic languages, 67 against 65 percent. But typed languages got more of the big fixes. At the same difficulty both land at about 65 percent, Python at 67. The biggest spread is inside the typed group: Rust at 72, Go at 53 percent.

## TypeScript versus JavaScript

🔀 In the most debated comparison, the authors ran into wrong labels. A task's label is its repository's language, but the fix often edits other files: Preact and Svelte type-check their JavaScript, while many "TypeScript" tasks from Material UI change only plain JavaScript. In 472 of 823 tasks the label did not match. After relabelling and at the same difficulty, plain JavaScript did as well or better in all three benchmarks, by 2 to 6 points.

🛠️ One detail concerns Claude Code: with Anthropic's typescript-lsp plugin installed, the agent edited files through the shell, with sed and similar tools, in 70 of 75 runs, and the plugin, which only sees edits made with Claude Code's own Edit and Write tools, reported nothing. Only a hook blocking shell edits put type errors in front of the agent; the solve rate did not rise.

## Where the time goes

⏱️ In Vladimir Dementyev's own Rails and Rust runs, the authors read by hand 101 steps whose output named a type-style error. Only 16 were real type errors, such as a swapped route name that a test caught and the next step fixed. Most time went into checking work (30 to 55 percent) and reading code (14 to 44 percent). One agent spent almost 13 minutes on a single browser check, more than all the Ruby type errors in twelve runs combined.

## Typed Ruby

💎 In the cleanest experiment, four models got four tasks in 37signals' Fizzy app in three variants: plain Ruby, RBS with Steep, Sorbet with Tapioca. All 68 typed trials ended with a clean check, yet the solve rate did not move. When the checker complained, agents mostly silenced it, for example with untyped signatures; one model fought dozens of errors for 21 to 28 minutes.

## Context

⚖️ Evil Martians concludes that types did not help in any data it has, but does not advise dropping them: teams already on TypeScript or Sorbet should keep them, just not expect a migration to improve their agents. Its own runs are small, often one trial per configuration, and the firm also markets benchmarking sprints. All runs and scripts are public under the MIT licence in its coding-agents-myths repository. A different finding comes from [Shriram Krishnamurthi and Matthew Flatt](https://arxiv.org/abs/2606.01522): in their experiment with planted type errors in the language Shplait, detailed error messages helped agents repair them, and a type system helped more than test results alone. The studies measure different things: repairing a known error versus completing whole tasks.

Sources

Open in the interactive reader →

This post was selected, researched, written and rated by AI. The AI can be wrong: check the sources. Imprint, privacy policy and terms of service