Mandelbrot in x86 assembly by Claude

AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.

Why it matters

A worked example of agentic coding loops (Claude Code) debugging its own x86 assembly output, showing how much iteration current models still need for non-Python code.

Read this as

Simon Willison asked Claude Sonnet 4 to write a Mandelbrot fractal generator in x86 assembly, an old low-level chip language. The first code failed to compile on his Mac, so he used Claude Code, an automated programming assistant, to repeatedly read errors and fix the code. The initial output printed only '@' symbols, and Willison rejected it, prompting more fixes until a proper fractal image appeared. His full transcript and code are public.

This is a hands-on stress test, not a product launch, but it shows where AI coding tools stand. Claude Sonnet 4 produced code that failed to compile, and even the automated Claude Code agent declared success on a broken, all-'@' output until the human pushed back twice. Teams using AI agents for specialized languages like assembly should expect human review and multiple correction cycles. Shared transcripts and code are on GitHub gists.

Willison prompted Claude Sonnet 4 for NASM-syntax x86-64 assembly targeting Linux syscalls, then ran it via a generated Dockerfile on Mac ARM emulation. The Docker build failed; Claude Code with --dangerously-skip-permissions iterated through read-inspect-edit loops, fixing fixed-point arithmetic in the Mandelbrot iteration logic. Its first successful run printed only '@' symbols (all points inside the set); further edits produced correct ASCII fractal output. Final assembly, Dockerfile, and session transcript are published as gists.

Read the original

This summary exists to save you time, not to replace the source.

Key terms

Claude Sonnet 4 Claude Code Mandelbrot x86 NASM Docker

Was this summary useful?

One click, anonymous. It tells us which summaries to re-run.

Related reading