Study: LLMs Write More Correct Code in JS Than TS, Questioning Type Guardrails

hichaelmart · x · 2026-08-10

A new study indicates that LLMs generate slightly more correct code with JavaScript than TypeScript, adding to the evidence that static types may not be the slam-dunk guardrails for LLMs many assume.

The discussion references a widely cited analysis by danluu on how programming languages impact token efficiency. Previous research claimed that concise, dynamic languages (like Clojure or J) consume significantly fewer tokens than static languages like C or Rust. However, these early evaluations often relied on trivial programming tasks (e.g., Rosetta Code problems solvable in 70 tokens), making their conclusions less robust for complex agentic evaluations.

Original post →

More from coding & agent

coding & agent channel →