« All posts

AI Coding Agents Build Chess Engines From Scratch in Rust to Brainfuck

AI coding agents built UCI chess engines from scratch across 12 languages, including LaTeX and Brainfuck, with some reaching 2000+ Elo.

A research experiment tasked AI coding agents (Claude Code and Codex CLI) with writing UCI-compliant chess engines from scratch, with minimal guidance, across 12 programming languages. Beyond mainstream choices like Rust, C++, Java and Python, the study covered proof-assistant languages such as Rocq and Why3/OCaml, plus esoteric ones never before used for chess: COBOL, LaTeX, SQL, and Brainfuck — yielding over 20 distinct engines.

Engines were ranked via gauntlet matches against Stockfish across five Elo levels, 50 games each. Top performers in Java, Rust, C++, C, and Python reached 1950–2200 Elo using bitboards, PVS with pruning, and transposition tables. Mid-tier engines in COBOL and Why3 landed between 1500–1900 Elo, while heavily constrained languages like LaTeX, SQL, and Brainfuck still produced playable, if weaker, engines — as low as ~900 Elo in one LaTeX build.

The results matter for engineers because they show coding agents can now assemble non-trivial, end-to-end software without architecture documents or step-by-step plans, adapting their designs to each language's constraints. Performance varied by roughly four orders of magnitude between the fastest and slowest engines, yet algorithmic quality in languages like Python partially offset raw speed disadvantages.

This synthesis was produced from its source by AI; there is no human editor or manual review step. How we work