What's the best programming language for coding agents?

danluu.com
August 10, 2026
53 min read
60/100
Summary
Dynamically typed programming languages are generally more token efficient in LLMs compared to statically typed languages due to their ability to omit explicit type declarations. This efficiency leads to lower token costs when coding agents.
Key Takeaways
- Dynamically typed languages generally have a lower LLM token cost than statically typed languages due to the omission of explicit type declarations, making the code more compact.
- Clojure is identified as the most token-efficient language in the comparison, while C ranks as the least efficient, with a gap of 2.6x between them.
- Array languages, like J, can achieve high token efficiency, averaging just 70 tokens, nearly half that of Clojure's 109 tokens.
- Performance on trivial tasks does not generalize, and the results of evaluations can be misleading if the problems are overly simplistic.
Coverage & discussions
Hacker News · danluu.com
Community discussions
Historical count: 5 · 5 saved in sample · Historical sample
Analysis ready
Community Sentiment
Positives
- Go is hailed as a top choice for LLMs due to its simplicity and consistency in training data, making it easier for models to generate reliable code.
- Commenters note that frontier LLMs excel at picking up various programming languages quickly, which is a promising sign for future applications.
- Some users have been pleasantly surprised by how well LLMs handle Gleam and Lustre, suggesting that languages focusing on human-friendly features may also benefit AI models.
Concerns
- Many commenters argue that Python's training data is tainted by poor-quality code from non-software engineers, which hampers LLM performance.
- One user expresses frustration with LLMs' performance in Gleam, noting they often produce incorrect or irrelevant code due to biases in training data.
- There are concerns about evaluating programming languages solely based on token efficiency, as it may overlook how LLMs actually handle real-world programming tasks.
Related Articles

Agentic coding notes from Galapagos Island
Jul 4, 2026

Anthropic/OpenAI may be spending more than $1000 for every $100 you pay them
Jun 7, 2026

Experts Have World Models. LLMs Have Word Models
Feb 8, 2026

The Future of Everything Is Lies, I Guess
Apr 8, 2026

Guardian Angels: LLM Personalization for Productivity and Security
Jul 14, 2026