Industry Insights 13 min read

Hardcore Benchmark: Which Language AI Loves Most? Comparing 13 Languages and Go’s Performance

A quantitative benchmark by Ruby core contributor Yusuke Endoh uses Claude Code (Opus 4.6) to implement a mini‑Git across 13 programming languages, revealing that dynamic languages like Ruby, Python and JavaScript dominate AI coding speed and cost, while Go lands in a solid second tier with perfect reliability.

TonyBai
TonyBai
TonyBai
Hardcore Benchmark: Which Language AI Loves Most? Comparing 13 Languages and Go’s Performance

Experiment Design: Let AI Write a Mini‑Git

The benchmark tasks Claude Code (Opus 4.6) with building a simplified Git implementation (mini‑git) that covers file I/O, hashing, data‑structure manipulation, and a CLI. The test is split into two phases:

v1 (new project): implement init, add, commit, log.

v2 (feature extension): add status, diff, checkout, reset, rm, show.

The prompt is minimal: “Read SPEC-v1.txt, implement it, and ensure test-v1.sh passes.” Each language/configuration is run 20 times to smooth out LLM randomness, recording Time, Cost (token consumption) and LOC.

Languages Tested

13 languages in 15 configurations:

Dynamic: Python, Ruby, JavaScript, Perl, Lua

Dynamic + type checker: Python/mypy, Ruby/Steep

Static: TypeScript, Go, Rust, C, Java

Functional: Scheme (dynamic), OCaml (static), Haskell (static)

Core Findings: Dynamic Languages Lead, Go in Second Tier

First tier – Ruby, Python, JavaScript dominate with total times of 73.1 s, 74.6 s and 81.1 s respectively, sub‑$0.40 token cost, and negligible variance across 20 runs. Their minimal project‑initialisation (no Cargo.toml or package.json) lets the AI generate code instantly.

Second tier – Go and Java record total times of 101.6 s (cost $0.50) and 115.4 s. Go shows no failures in 20 runs, demonstrating its compiler’s strong guard against “hallucination bugs.”

Third tier – Rust and C struggle: Rust (113.7 s, 2 failures) and C (155.8 s) exhibit higher latency and occasional crashes.

Why AI Prefers Dynamic Languages

Training‑data “siphon effect” : Python, JavaScript and Ruby dominate open‑source repositories and StackOverflow, giving Claude Code abundant pre‑training exposure.

Static typing as a double‑edged sword : Strict type checks create friction for the AI’s generate‑‑test‑debug loop. Examples include lengthy token consumption to resolve Rust borrow‑checker errors and extensive refactoring of structs and signatures in Java.

Added type‑checking overhead : Benchmarks show Python vs Python/mypy (74.6 s → 125.3 s) and Ruby vs Ruby/Steep (73.1 s → 186.6 s), a 1.6‑3× slowdown when type annotations are enforced.

LOC Myth Debunked

Functional languages Haskell (174 s) and OCaml (216 s) produce the fewest lines (224 l, 216 l) yet rank among the slowest, indicating that highly abstract, dense code raises generation entropy for LLMs.

Industry Implications

For rapid prototyping, dynamic languages (Python, TypeScript) are optimal. However, for high‑concurrency, memory‑critical services, Go remains indispensable despite slower AI generation, thanks to its 100 % success rate and readable, uniform code that eases human review.

Future directions may include AI‑native intermediate languages or “agent‑friendly” compilation modes for Go and Rust that provide structured, LLM‑aware error‑fix suggestions.

Takeaway

The benchmark (github.com/mame/ai-coding-lang-bench) shows that LLMs favor languages with massive training data, flexibility, and minimal compiler friction, reshaping how we evaluate language suitability in the AI‑driven development era.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LLMAI codingGostatic typingClaude Codedynamic languageslanguage benchmark
TonyBai
Written by

TonyBai

Tony Bai's tech world (tonybai.com). Not satisfied with just "knowing how", we strive for mastery. Focused on Go language internals, high-quality engineering practices, and cloud‑native architecture, exploring cutting‑edge intersections of Go and AI. Gophers who pursue technology are welcome—follow me and evolve with Go.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.