Claude Code에 가장 적합한 프로그래밍 언어는 무엇입니까?

hackernews | | 🔬 연구
#claude #claude code #git #review #성능 비교 #정적 타입 #프로그래밍 언어
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

AI 코딩 에이전트를 위한 최적의 언어를 찾기 위해 13개 언어로 간소화된 Git을 구현하는 실험을 진행했습니다. 그 결과, Ruby, Python, JavaScript 같은 동적 언어들이 가장 빠르고(73~81초) 비용 효율적($0.36~0.39)인 것으로 나타났습니다. 반면, 정적 타입 언어들은 1.4~2.6배 더 느리고 비용이 높았으며, 오히려 동적 언어에 타입 검사기를 추가했을 때 성능 저하가 더 크다는 결론이 도출되었습니다.

본문

I had Claude Code implement a very simplified version of Git in 13 languages. Ruby, Python, and JavaScript were the fastest, cheapest, and most stable. Statically typed languages were 1.4–2.6× slower and more expensive. Which programming language is best suited for AI coding agents? "Static typing prevents AI hallucination bugs!" "No, skipping type annotations saves tokens!" There's plenty of qualitative debate, but quantitative data is scarce. So I ran an experiment. I asked Claude Code to implement a "mini-git" — a simplified version of Git — in various languages, and measured the time and cost for each. Git was famously built by Linus in two weeks, so it seemed like a good task. The task was split into two phases: - v1 (New project): Implement init ,add ,commit , andlog . - v2 (Feature extension): Add status ,diff ,checkout , andreset . The prompt was simply: "Read SPEC-v1.txt, implement it, and make sure test-v1.sh passes." v2 was analogous. The languages compared: | Category | Languages | |---|---| | 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) | Python/mypy writes fully type-annotated Python verified with mypy --strict . Ruby/Steep writes RBS type signatures verified with steep check . These allow direct comparison of type-checking overhead within the same language. Each language was run 20 times. The model was Claude Opus 4.6 (high effort). Average results across 20 trials, sorted by average cost. | Language | Tests passed (v1+v2) | Time (v1+v2) | Avg. cost | LOC (v2) | |---|---|---|---|---| | Ruby | 40/40 | 73.1s ± 4.2s | $0.36 | 219 | | Python | 40/40 | 74.6s ± 4.5s | $0.38 | 235 | | JavaScript | 40/40 | 81.1s ± 5.0s | $0.39 | 248 | | Go | 40/40 | 101.6s ± 37.0s | $0.50 | 324 | | Java | 40/40 | 115.4s ± 34.4s | $0.50 | 303 | | Rust | 38/40 | 113.7s ± 54.8s | $0.54 | 303 | | Perl | 40/40 | 130.2s ± 44.2s | $0.55 | 315 | | Python/mypy | 40/40 | 125.3s ± 19.0s | $0.57 | 326 | | OCaml | 40/40 | 128.1s ± 28.9s | $0.58 | 216 | | Lua | 40/40 | 143.6s ± 43.0s | $0.58 | 398 | | Scheme | 40/40 | 130.6s ± 39.9s | $0.60 | 310 | | TypeScript | 40/40 | 133.0s ± 29.4s | $0.62 | 310 | | C | 40/40 | 155.8s ± 40.9s | $0.74 | 517 | | Haskell | 39/40 | 174.0s ± 44.2s | $0.74 | 224 | | Ruby/Steep | 40/40 | 186.6s ± 69.7s | $0.84 | 304 | Out of 600 runs (15 languages × 2 phases × 20 trials), only 3 failed (tests did not pass). The failures were Rust (2) and Haskell (1). In one of the Rust failure logs, the agent claimed "the tests are wrong." Since all other Rust trials succeeded, this appears to be a hallucination. Dot plots of total time (v1 + v2): And cost: Ruby, Python, and JavaScript are the top 3: 73–81 seconds, $0.36–0.39, with low standard deviations — fast and stable. From 4th place onward (Go, Rust, Java), variance increases sharply. Go averages 102s but with ±37s of spread. Time and cost are strongly correlated: LOC after v2 completion: OCaml (216), Ruby (219), and Haskell (224) are the most compact. C stands out at 517 lines. Interestingly, fewer LOC does not imply faster or cheaper generation. OCaml and Haskell are compact but mid-to-low in speed and cost efficiency. Breakdown by phase: | Language | v1 Time | v1 Turns | v1 LOC | v1 Tests | v2 Time | v2 Turns | v2 LOC | v2 Tests | Total Time | Avg. Cost | |---|---|---|---|---|---|---|---|---|---|---| | Ruby | 33.2s± 2.5s | 6.0 | 107 | 20/20 | 40.0s± 3.0s | 7.0 | 219 | 20/20 | 73.1s± 4.2s | $0.36 | | Python | 32.9s± 1.3s | 6.0 | 113 | 20/20 | 41.8s± 4.5s | 7.1 | 235 | 20/20 | 74.6s± 4.5s | $0.38 | | JavaScript | 36.0s± 3.5s | 6.0 | 123 | 20/20 | 45.1s± 4.1s | 7.2 | 248 | 20/20 | 81.1s± 5.0s | $0.39 | | Go | 47.5s±34.5s | 7.7 | 143 | 20/20 | 54.1s±12.3s | 9.7 | 324 | 20/20 | 101.6s±37.0s | $0.50 | | Java | 64.3s±31.1s | 8.7 | 152 | 20/20 | 51.2s± 8.1s | 9.6 | 303 | 20/20 | 115.4s±34.4s | $0.50 | | Rust | 53.6s±36.7s | 9.4 | 139 | 19/20 | 60.1s±19.2s | 10.1 | 303 | 19/20 | 113.7s±54.8s | $0.54 | | Perl | 84.4s±43.1s | 9.2 | 173 | 20/20 | 45.7s± 6.8s | 7.5 | 315 | 20/20 | 130.2s±44.2s | $0.55 | | Python/mypy | 52.7s± 8.3s | 9.2 | 171 | 20/20 | 72.6s±14.4s | 12.2 | 326 | 20/20 | 125.3s±19.0s | $0.57 | | OCaml | 80.9s±28.8s | 11.2 | 111 | 20/20 | 47.1s± 6.0s | 9.2 | 216 | 20/20 | 128.1s±28.9s | $0.58 | | Lua | 96.4s±42.8s | 10.1 | 226 | 20/20 | 47.2s± 5.2s | 8.1 | 398 | 20/20 | 143.6s±43.0s | $0.58 | | Scheme | 66.7s±36.7s | 8.9 | 171 | 20/20 | 63.9s±10.0s | 10.6 | 310 | 20/20 | 130.6s±39.9s | $0.60 | | TypeScript | 69.9s±18.8s | 12.2 | 149 | 20/20 | 63.1s±17.8s | 11.3 | 310 | 20/20 | 133.0s±29.4s | $0.62 | | C | 65.0s±18.2s | 8.2 | 276 | 20/20 | 90.8s±39.1s | 13.7 | 517 | 20/20 | 155.8s±40.9s | $0.74 | | Haskell | 74.3s±39.1s | 10.3 | 119 | 19/20 | 99.6s±32.4s | 16.4 | 224 | 20/20 | 174.0s±44.2s | $0.74 | | Ruby/Steep | 105.0s±65.2s | 20.2 | 150 | 20/20 | 81.6s± 8.8s | 17.2 | 304 | 20/20 | 186.6s±69.7

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →