Red, orange and cream pixels scattered on deep maroon

Link · danluu.com ↗

How does programming language affect token efficiency and correctness?

Toy evals said dynamic languages cost agents fewer tokens and fail less. Two larger tasks, a zstd decoder and pandoc, dissolved the pattern. Building the eval surfaced 100+ bugs of its own.

Why we picked it · the editor's summary

Luu takes the claim that dynamic languages are two to three times more token-efficient than static ones, with J at nearly half of Clojure's count, and reruns it on two tasks with real surface area: a Zstd decoder written from the RFC and a modified pandoc task from ProgramBench, scoring token cost against correctness. At medium effort the dynamic-language edge shows up about as advertised; at the highest effort level the picture is mixed and static languages hold their own or win. Language popularity tracks performance weakly to moderately. He is explicit that this is two tasks, that trivial-problem evals mislead, and that his own harness still has flaws he has not found. The advice is dull on purpose: use a mainstream language and stop optimizing for token density.

Read on danluu.com49m read

Comments

Loading comments…