AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
InfoQ·2026年4月6日 13:01·約6分で読める

13言語Claude Codeベンチマークで動的言語が高速かつ低コストと判明

#コード生成#ベンチマーク#プログラミング言語#Claude#開発効率#コスト最適化
TL;DR

RubyコミッターYusuke Endohによる13言語のClaude Codeベンチマークで、Ruby、Python、JavaScriptなどの動的型付け言語が静的型付け言語より高速かつ低コストで、型チェッカーの追加は1.6-3.2倍の速度低下をもたらすことが示された。

AI深層分析2026年4月6日 14:40
3
注目/ 5段階
深度40%
3
関連度30%
4
実用性20%
3
革新性10%
2

キーポイント

1

動的言語の優位性

Ruby、Python、JavaScriptなどの動的型付け言語が、13言語のClaude Codeベンチマークで静的型付け言語よりも高速かつ低コスト(1回あたり$0.36-$0.39)であることが確認された。

2

静的型付け言語のコスト

静的型付け言語は動的型付け言語に比べて1.4-2.6倍のコストがかかり、実行効率の面で劣ることが示された。

3

型チェッカーの影響

動的型付け言語に型チェッカーを追加すると、1.6-3.2倍の速度低下が発生し、型安全性と実行速度のトレードオフが明確になった。

4

ベンチマークの詳細

600回の実行からなるベンチマークでは簡略化されたGitの実装が使用され、完全なデータセットはGitHubで公開されている。

影響分析・編集コメントを表示

影響分析

このベンチマーク結果は、AIコード生成ツールの実運用における言語選択の意思決定に影響を与える可能性がある。特にコスト効率を重視するプロジェクトでは動的型付け言語の採用が促進され、型安全性と実行効率のバランスに関する議論を深める契機となる。

編集コメント

実用的なベンチマークデータを提供している点は評価できるが、ベンチマーク手法や条件の詳細が限定的であり、より広範な検証が必要。開発現場での言語選択判断の一材料として参考になる。

Ruby コミッターの遠藤裕介氏による新しいベンチマークは、Claude Code が 13 のプログラミング言語で動作する実装をどの程度効率的に生成するかを検証しました。600 回以上の実行において、動的言語(具体的には Ruby、Python、JavaScript)は一貫して最速で、最も安価かつ安定しており、静的型付け言語は 1.4 倍から 2.6 倍遅く、コストも高くなりました。

この実験は DEV Community で公開され、すべてのコードと結果が GitHub で入手可能です。Claude Code (Opus 4.6) に、各言語で Git の簡易版を実装するよう依頼しました。タスクは 2 つのフェーズに分かれました:v1 では空のディレクトリから init、add、commit、log を実装し、v2 では status、diff、checkout、reset をプロジェクトに追加しました。各言語で 20 回ずつ実行されました。著者は、言語間のライブラリ依存関係の差異を排除するため、SHA-256 ではなくカスタムハッシュアルゴリズムを使用しました。

Ruby の実行あたりの平均コストは 0.36 ドル、所要時間は 73.1 秒でした。Python は実行あたり 0.38 ドル、74.6 秒、JavaScript は実行あたり 0.39 ドル、81.1 秒でした。これら 3 つの言語は分散が小さく、40 回の全テストをパスしました。4 位以降になるとコストが増加し、分散も急激に拡大しました。Go の平均コストは 0.50 ドル、所要時間は 101.6 秒でしたが、標準偏差は 37 秒に達しました。Rust の平均コストは 0.54 ドルでしたが、54.8 秒という最大のばらつきを示し、テスト失敗が発生した 2 つの言語の一つでした。C は主要な言語の中で最も高価で、コストは 0.74 ドルでした。これは Ruby の 219 行に対して 517 行のコードを生成したことが重荷となりました。

型システムの調査結果は、AIコーディングワークフローを評価するチームにとって最も実用的な成果である可能性があります。Pythonにmypyの厳格なチェックを追加すると、実行速度は1.6倍から1.7倍遅くなりました。RubyにSteepという型チェックを追加すると、さらに大きなペナルティが生じ、純粋なRubyと比較して2.0倍から3.2倍遅くなりました。TypeScriptは、生成される行数が似通っていたにもかかわらず、JavaScriptよりも著しく高価であり、平均コストはそれぞれ0.62ドルと0.39ドルでした。著者は、このオーバーヘッドは型注釈の生成だけでなく、モデルが型制約について推論する際に使用される思考トークン(thinking-token)の増加によるものだと指摘しています。

Endoh氏は透明性を保ちつつ、限界についても率直に述べています。彼はRubyのコミッターであり、その立場によるバイアスを明記しています。生成されたプログラムは約200行のコードであり、プロトタイピング規模に firmly 位置しており、静的型付けが大規模なコードベースでは有利になる可能性があることを認めています。この実験はまた、Anthropicの「Open Source Program for Claude」によって支援されており、同プログラムから6ヶ月間の無料Claude Maxアクセスが提供されました。このベンチマークは生成コストと速度のみを測定しており、コードの品質、保守性、またはランタイムパフォーマンスは評価していません。

Lobstersでの議論では、200行の出力からプロトタイピング規模の結論を導き出せるかという疑問が呈され、あるコメント投稿者は「非常に有用なプロトタイプはそれほど小さいものではない」と指摘しました。他の意見では、このベンチマークがエコシステムの優位性を考慮していないことが挙げられました。つまり、強力なパッケージエコシステムを持つ言語は、現実的なタスクにおいて生成されるコードの量が少なくて済むということです。DEV Communityの記事に対するコメント投稿者は、定性的な懸念を提起しました。「生成されたコードがその後の修正が困難になる場合、2倍の速度向上は相殺される可能性がある」という点と、「RustやHaskellでのテスト失敗は単にバグとして分類すべきではなく、厳格な型システムはエラーを早期に発見するために設計されており、それが本番環境に到達するのを防ぐためである」という点です。

Endoh氏はこれらの点のいくつかを直接 addressing しています。規模について、彼はより大規模なベンチマークが有益であることに同意しつつも、15言語間で公平性を保つ設計の難しさを指摘しています。2倍の速度差については、反復的なAI支援開発において、30秒待つことと60秒待つことの差が開発者のフロー(集中状態)において重要であると主張しますが、将来のモデルが生成時間をサブ秒レベルに短縮すれば、この差は無意味になることも認めています。エコシステムの影響については、言語レベルの差異を孤立させるために意図的にライブラリ依存関係を除外し、その理由でカスタムハッシュ関数を使用しました。

全600回の実行のうち、失敗したのはわずか3回でした:Rustで2件、Haskellで1件です。あるRustの失敗ログでは、エージェントがテストに誤りがあると主張しましたが、他のすべてのRust試行が成功していたことから、これは著者によってハルシネーション(幻覚)であると特定されました。

実行ごとの結果、実行ログ、生成されたすべてのソースコードを含む完全なデータセットは、ベンチマークリポジトリで公開されています。

著者について

Steef-Jan Wiggers

Steef-Jan Wiggersは、InfoQのシニアクラウドエディターの一人であり、オランダのVGZでドメインアーキテクトとして勤務しています。彼の現在の技術的専門知識は、インテグレーションプラットフォームの実装、Azure DevOps、AI、およびAzure Platform Solution Architectures(Azureプラットフォームソリューションアーキテクチャ)の実装に焦点を当てています。Steef-Janは定期的にカンファレンスやユーザーグループで講演を行い、InfoQ向けに記事も執筆しています。さらに、マイクロソフトは過去16年間、彼をMicrosoft Azure MVP(Microsoft Most Valuable Professional)として認定しています。

Show moreShow less

原文を表示

A new benchmark by Ruby committer Yusuke Endoh tested how efficiently Claude Code generates working implementations across 13 programming languages. Over 600 runs, dynamic languages, specifically Ruby, Python, and JavaScript, were consistently the fastest, cheapest, and most stable, while statically typed languages were 1.4 to 2.6 times slower and more expensive.

The experiment, published on DEV Community with all code and results available on GitHub, asked Claude Code (Opus 4.6) to implement a simplified version of Git in each language. The task was split into two phases: v1 implementing init, add, commit, and log from an empty directory, and v2 extending the project with status, diff, checkout, and reset. Each language was run 20 times. The author used a custom hash algorithm rather than SHA-256 to eliminate differences in library dependencies across languages.

Ruby averaged $0.36 per run at 73.1 seconds, Python came in at $0.38 per run and 74.6 seconds, and JavaScript at $0.39 per run and 81.1 seconds. All three had low variance and passed all tests across all 40 runs. From fourth place onward, costs rose, and variance increased sharply. Go averaged $0.50 at 101.6 seconds, yet with a standard deviation of 37 seconds. Rust averaged $0.54 but had the widest spread at 54.8 seconds and was one of only two languages with test failures. C was the most expensive mainstream language at $0.74, weighed down by generating 517 lines of code compared to Ruby's 219.

The type system findings may be the most practically useful result for teams evaluating AI coding workflows. Adding mypy strict checking to Python made it 1.6 to 1.7 times slower. Adding Steep type checking to Ruby imposed an even larger penalty, making it 2.0 to 3.2 times slower than plain Ruby. TypeScript was notably more expensive than JavaScript, averaging $0.62 versus $0.39, despite producing similar line counts. The author notes that the overhead is not just from generating type annotations but likely from higher thinking-token usage as the model reasons about type constraints.

Endoh is transparent about the limitations. He is a Ruby committer and flags that bias. The generated programs are roughly 200 lines of code, firmly at prototyping scale, and he acknowledges that static typing may prove advantageous in larger codebases. The experiment was also supported by Anthropic's Claude for Open Source Program, which provided six months of free Claude Max access. The benchmark only measures generation cost and speed, not code quality, maintainability, or runtime performance.

Discussion on Lobsters challenged whether prototyping-scale conclusions can be drawn from 200-line outputs, with one commenter noting that very few useful prototypes are that small. Others pointed out that the benchmark does not account for ecosystem advantages, where languages with strong package ecosystems would require less generated code for real-world tasks. A commenter on the DEV Community post raised a qualitative concern: that a 2x speedup is potentially offset if the generated code is harder to modify later, and that Rust and Haskell test failures should not simply be categorized as bugs, since stricter type systems are designed to catch errors early rather than letting them reach production.

Endoh addresses several of these points directly. On scale, he agrees that a larger benchmark would be valuable but notes the difficulty of designing one that is fair across 15 languages. On the 2x speed difference, he argues that in iterative AI-assisted development, the gap between waiting 30 seconds and 60 seconds matters for developer flow, though he concedes the difference becomes irrelevant if future models reduce generation times to sub-second levels. On ecosystem effects, he deliberately excluded library dependencies to isolate language-level differences, using a custom hash function for exactly this reason.

Out of 600 total runs, only 3 produced failures: two in Rust and one in Haskell. In one Rust failure log, the agent claimed the tests were wrong, which the author identified as a hallucination since all other Rust trials succeeded.

The full dataset, including per-run results, execution logs, and all generated source code, is available in the benchmark repository.

About the Author

Steef-Jan Wiggers

Steef-Jan Wiggers is one of InfoQ's senior cloud editors and works as a Domain Architect at VGZ in the Netherlands. His current technical expertise focuses on implementing integration platforms, Azure DevOps, AI, and Azure Platform Solution Architectures. Steef-Jan is a regular speaker at conferences and user groups and writes for InfoQ. Furthermore, Microsoft has recognized him as a Microsoft Azure MVP for the past sixteen years.

Show moreShow less

この記事をシェア

関連記事

Anthropic Research★32026年3月6日 09:00

2026年3月6日 Frontier Red TeamによるClaudeのCVE-2026-2796エクスプロイトのリバースエンジニアリング

Frontier Red Teamが、Claudeの脆弱性CVE-2026-2796を悪用するエクスプロイトをリバースエンジニアリングした。

Anthropic Research★32026年3月6日 09:00

フロンティア・レッドチーム、Firefoxのセキュリティ向上のためにMozillaと提携

フロンティア・レッドチームは、Firefoxのセキュリティを向上させるため、Mozillaと提携した。

宝玉的分享★42026年2月17日 09:00

59%のユーザーがより安価なモデルを選択:Sonnet 4.6の詳細解説

Anthropic社がClaude Sonnet 4.6をリリースし、Claude Codeテストで70%のユーザーが前世代モデルより好み、59%がフラッグシップモデルOpus 4.5よりも選択した。コーディング、コンピュータ利用、100万トークンコンテキストなど6次元で全面アップグレードされ、価格は据え置き。

ニュース一覧に戻る元記事を読む