Reason #72 • March 13th, 2026

The most token-efficient programming language

Ruby's main claim to fame is that it is the most human-oriented programming language, optimised for developer happiness first and foremost.

As a Ruby developer myself, I certainly subscribe to the idea that Ruby's incredible expressiveness makes it easier both to read and write compared to other languages.

But is it just my personal bias, or is it actually true?

An interesting development since the recent rise of LLMs doing programming for us is that we can now attempt to measure how "easy" it is for an LLM to work with different programming languages. If we imagine that token processing is a proxy for cognitive load on the LLM, then measuring the number of tokens it has to spend to execute similar tasks across different languages should give us an idea of how "easy" different languages are to use.

Some investigations in this direction have been made recently.

In January, Martin Alderson published a blog post taking a look at the token efficiency of different programming languages. This was a very small-scale experiment, and only focused on counting output tokens of already existing code snippets. Nevertheless, it concluded that Clojure, Julia and Ruby were the top 3 most "token efficient" languages.

So far so good, but understanding that Ruby requires "fewer tokens" to express the same thing as most other languages should be self-evident to anyone who has even glanced at Ruby code before. A more interesting question would be how token efficient Ruby would be end to end, working on a programming task of some significance.

On 5 March, Yusuke Endoh published the article Which programming language is best for Claude code? in which he measured the cost, a proxy for token usage, of different programming languages solving the same programming task: building a simple version of git.

In this experiment, Ruby was not only the fastest and most token-efficient language, but also the most stable in its output across the 20 runs executed against it.

One day later, @banteg reproduced the test with additional programming languages using GPT-5.4 medium and published his results on X. Again, Ruby came out the winner in both token efficiency and stability.

These are early signs that Ruby is objectively less cognitively taxing for LLMs to use, which I believe suggests that it is similarly less taxing for human developers as well.

Even if you find the comparison of LLM load to human load a stretch, Ruby being such a token-efficient language is at the very least a significant win in this new age of agentic engineering!

Reason #73 ?