# The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languages

DevFeed: [The Best Programming Language for Tokenmaxxing: An Investigation of Coding Agent Behavior Across Programming Languages](<https://devfeed.tech/articles/the-best-programming-language-for-tokenmaxxing-an-investigation-of-coding-agent-behavior-across-programming-languages-94602.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2607.22807>)

Author: Zixuan Wu, Carolyn Jane Anderson, Arjun Guha

Published: 2026-10-22T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [agentic-coding](<https://devfeed.tech/topics/agentic-coding.md>), [Programming Languages / Compilers](<https://devfeed.tech/topics/programming-languages-compilers.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agents](<https://devfeed.tech/tags/agents.md>), [behavior](<https://devfeed.tech/tags/behavior.md>), [benchmarking](<https://devfeed.tech/tags/benchmarking.md>), [code](<https://devfeed.tech/tags/code.md>), [code-comments](<https://devfeed.tech/tags/code-comments.md>), [coding](<https://devfeed.tech/tags/coding.md>), [coding-agent](<https://devfeed.tech/tags/coding-agent.md>), [coding-agents](<https://devfeed.tech/tags/coding-agents.md>), [cost](<https://devfeed.tech/tags/cost.md>), [cs-cl](<https://devfeed.tech/tags/cs-cl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [efficiency](<https://devfeed.tech/tags/efficiency.md>), [investigation](<https://devfeed.tech/tags/investigation.md>), [java](<https://devfeed.tech/tags/java.md>), [language](<https://devfeed.tech/tags/language.md>), [languages](<https://devfeed.tech/tags/languages.md>), [metric](<https://devfeed.tech/tags/metric.md>), [models](<https://devfeed.tech/tags/models.md>), [programming](<https://devfeed.tech/tags/programming.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [programming-languages](<https://devfeed.tech/tags/programming-languages.md>)

## AI overview

Across five recent models, token use on programming problems varied substantially by language among Python, Java, Rust, and OCaml, even after controlling for problem difficulty; the variation was consistent across models. To investigate, the researchers re-executed intermediate solutions and analyzed test outcomes and trajectory text. They report repeated noncompiling attempts in unfamiliar languages, revisions to solutions that already passed, planning in code comments, invented inputs that displaced provided tests, and Python prototyping as a way to sidestep unfamiliar target languages. The authors argue that language-specific token efficiency matters when benchmarking and developing multilingual coding agents.

## Source excerpt

arXiv:2607.22807v2 Announce Type: replace Abstract: Although coding agents are now very effective in a variety of programming languages, this paper first shows that the cost (in tokens) can very significantly by programming language. We evaluate five recent models on programming problems in Python, Java, Rust, and OCaml. We carefully control for problem difficulty, and show that there can be stark variation in token consumption that is consistent across models. To understand why, we analyze both the structure and content of agent trajectories. First, we re-execute every intermediate solution and abstract each trajectory as a sequence of test-outcome vectors, then label the work between successive solutions. This reveals agents repeatedly producing noncompiling solutions in unfamiliar languages and revising solutions that already pass. Second, we analyze trajectory text, finding that agents plan solutions in code comments, distrust the provided tests in favor of inputs they invent, and sidestep unfamiliar target languages by prototyping in Python. Our results show that by-language token efficiency is a metric that should be considered when benchmarking and developing multilingual agents, and, for the tokenmaxxer, a guide to the most expensive language to work in.