The Token Tax: How Language Choice Impacts AI Coding Costs
Researcher Dan Luu's analysis shows that language verbosity directly affects the financial and technical efficiency of LLM-based coding agents.
The choice of programming language is no longer just a matter of developer preference or system performance; it is now a financial variable in the deployment of AI. Researcher Dan Luu recently published an analysis titled "What's the best programming language for coding agents?" which examines how different languages impact the token consumption of LLM-based agents.
Because LLMs process code as tokens, the verbosity of a language directly correlates to the cost of every AI-assisted edit. Verbose languages that require significant boilerplate, such as Java or C++, increase API costs and slow down the generation process. Furthermore, these languages put additional pressure on the model's context window, limiting the amount of code an agent can analyze at one time. This means that a team's language choice effectively changes the price of AI-driven development.
The Efficiency Debate
A central point of contention in the industry is the perceived efficiency of dynamic versus static languages. Dan Luu notes a common claim—originally cited from a post by Martin Aderson—that dynamic languages can be two to three times more token-efficient than static languages like Rust or Go. This efficiency stems primarily from the absence of explicit type declarations, which reduces the total number of tokens required to express the same logic.
However, the conversation has expanded beyond simple token counts. In discussions on Hacker News, contributors have argued that token density is only one part of the equation. Many suggest that Go is an excellent choice for LLMs not necessarily because of token counts, but because of its consistency, consistent training data, and superior tooling. The combination of fast compilation and efficient linting shortens the agent's iteration cycle, allowing the AI to test and fix errors more rapidly than in languages with slower build times.
Operational Implications
For organizations building large-scale agentic systems, this "token tax" creates a tangible technical constraint. The operational cost of AI edits is directly tied to the language's syntax density. If an agent consumes more tokens to perform a simple task, the cost per feature increases, and the agent's "vision"—the amount of codebase context it can hold in memory—is reduced.
This creates a complex trade-off for engineering leaders. While a more concise language might lower API bills, it must be balanced against the availability of high-quality training data for that language and the existing expertise of the human developers who must oversee the agent's output.
Looking Ahead
As coding agents move from simple autocomplete tools to autonomous entities that write, test, and iterate, the industry is still determining whether raw token efficiency or tooling speed is the primary driver of productivity. While the data suggests that dynamic languages save tokens, the practical utility of static languages with fast feedback loops, like Go, remains a critical point of debate for those optimizing agentic workflows.