The problem
How it works
He first asked Codex CLI (running GPT-5.2) to write a spec, then to reach a small smoke-test milestone, and then let it port Emil Stenström's JustHTML HTML5 parser using the html5lib conformance tests as the target. He ran it with approvals and sandboxing switched off and followed progress through the commits it pushed to GitHub. Later prompts added CI, a browser playground and a README.
Results and limitations
He reports roughly 9,000 lines of JavaScript across 43 commits in about four and a half hours, passing nearly all html5lib tests (for example 6810/6810 tokenizer tests), at an estimated API-equivalent cost of $29.41 that his $20/month ChatGPT Plus plan covered.
Before you try it
One experiment on a project with an unusually complete test suite, and a straight port rather than an idiomatic redesign. He ran it with --yolo (no sandbox), the plan's usage window ran out midway, and he leaves copyright and production-trust questions open.
Tools and repositories
- Tools
- Codex CLI · GPT-5.2 · GitHub Actions · html5lib-tests
- Prerequisites
- Works best when the source project already has a thorough, language-neutral test suite; needs a ChatGPT plan or API access for Codex.
Try it yourself: Port a library to another language against its test suite
Fill the fields to adapt the prompt. Empty fields stay as visible [placeholders].
You are porting [Library to port] from [Source language] to [Target language] in [Target repository path]. First, read the source and write SPEC.md describing the public API, the module layout and how you will run [Test suite to pass] against the new code. Show me the spec and a milestone plan, then wait for my approval. After approval, implement one milestone at a time, run the tests after each, and commit locally with a short message that reports pass and fail counts. Do not add runtime dependencies, push to any remote, or delete files outside the target directory without asking. Stop and report if any test category stays below [Minimum pass rate] after three attempts.Run it on a disposable branch or container, and treat passing tests as necessary but not proof of correctness or licensing clearance.
Related videos
About openai/codex
Meet the New Codex CLI (opens in a new tab)
Published by the project’s official channel.
Watch on YouTube (opens in a new tab)Independent creators. Listing a video implies no endorsement, sponsorship or partnership.
Sources
- I ported JustHTML from Python to JavaScript with Codex CLI and GPT-5.2 in 4.5 hours (opens in a new tab)
First-person account · simonwillison.net · Published 15 Dec 2025 · Source checked 9 Nov 2026, 22:15 UTC
What this source supports
- Codex CLI with GPT-5.2 ported JustHTML to JavaScript
- About 9,000 lines over 43 commits in roughly 4.5 hours
- Near-complete html5lib test pass rates
- Estimated $29.41 API cost covered by a $20/month plan
