Table of Contents

Vibe Porting: Using AI Agents to Port Code Between Languages

Vibe porting (also called vibespiling) is the practice of using AI coding agents to port software from one programming language to another. It is a practical pattern where AI excels because the existing codebase serves as both the specification and the test oracle – the agent knows exactly what the code should do and can verify its output against the original implementation.

Origin of the Term

The term vibespiling was coined by Emil Stenström, inspired by Simon Willison's coding agent port of JustHTML from Python to JavaScript. Willison subsequently adopted the term vibe porting to describe this broader pattern1). Willison has used the term in his blogmarks to describe cases where existing test suites enable AI-driven rewrites2).

Why AI Excels at Porting

Code porting is uniquely well-suited to AI agents for several reasons:

Case Studies

JustHTML: Python to JavaScript

Simon Willison ported Emil Stenström's JustHTML – a standards-compliant HTML5 parser written in pure Python using coding agents – from Python to JavaScript using Codex CLI and GPT-5.2. The result was simonw/justjshtml, a dependency-free HTML5 parsing library that passes 9,200 tests from the html5lib-tests suite3).

Key details:

html5rw: Python to OCaml

Anil Madhavapeddy, inspired by the JustHTML port, built html5rw – an HTML5 parser in OCaml that passes the same html5lib-tests suite. This was part of his “Advent of Agentic Humps” project, building a new useful OCaml library every day in December 20254).

JSONata: JavaScript to Go ($500K/year savings)

Reco, a cybersecurity company, used AI to rewrite the JSONata JSON expression language from JavaScript to Go in 7 hours for $400 in Claude tokens. Willison described this as “another case study of vibe porting”5).

The background: Reco's pipeline runs in Go, but JSONata's reference implementation is JavaScript. For years they ran a fleet of Node.js pods on Kubernetes that their Go services called over RPC, costing approximately $300K/year in compute with 150-microsecond RPC latency on every evaluation((Source: [[https://www.reco.ai/blog/we-rewrote-jsonata-with-ai|Reco - We Rewrote JSONata with AI in a Day, Saved $500K/Year]])).

The approach:

The enabling factor, as with all vibe porting projects, was the existing comprehensive test suite.

Patterns for Success

Ethical Considerations

Madhavapeddy raised important questions about the copyright and ethics of vibespiling: “I am also extremely uncertain about ever releasing this library to the central opam repository, especially as there are excellent HTML5 parsers already available. Whether or not this agentic code is better or not is a moot point if releasing it drives away the human maintainers who are the source of creativity in the code!”6)

See Also

References