Clojure and Language Density

Speculation that dense languages with simple primitives perform better with LLMs, one-shot performance comparisons across programming languages

← Back to Harness engineering: Leveraging Codex in an agent-first world

Observations suggest that programming languages with high density and simple primitives, such as Clojure, may allow LLMs to produce faster and more accurate results despite having less presence in training data. This phenomenon is highlighted by one-shot performance levels in Clojure that rival much more popular languages like Python, suggesting that a lower token count helps the model "wrangle" logic more effectively. While smaller file sizes generally lead to better immediate responses, there is still debate over whether these benefits persist in massive codebases where fragmented context might hinder the LLM’s understanding. Ultimately, the inherent structural simplicity of dense languages appears to compensate for their lack of mainstream popularity in the eyes of artificial intelligence.

1 comment tagged with this topic

View on HN · Topics
Seconded on smaller files. I feel like I tend to get better responses faster. A notable flaw here is that I’ve not tried large vs small files in a large codebase. Most of my experimentation there has been on personal projects where even a small file contains a significant part of the project. I could see degradation when it has to load 5 files to figure out how something works. Total LOC (tokens, really, literal lines probably don’t matter) is interesting as a factor. That might go some way towards explaining why LLMs are weirdly good at Clojure. Eg last I checked Anthropics one-shot performance on Clojure was about the same as Python or Go despite almost certainly being less represented in training data. The combination of density and simple primitives might be easier for an LLM to wrangle, ameliorating the impact of a less popular language.