Skip to content
Putting technology to work.
Insights to guide decisions and action.

Search articles

Bun rewritten from Zig to Rust in six days: designing large-scale LLM code migrations for clients in 2026

Table of contents · 11 items

On May 17, 2026, discussions around Bun Being Rewritten to Rust in 6 Days and JavaScript Runtime Bun Migrating Core Language from Zig to Rust Using Claude spread widely across Hacker News. Bun, a JavaScript runtime whose core was originally implemented in Zig, rewrote it into Rust in 6 days with assistance from Claude Code. This serves as an iconic example showing that "large-scale language migrations powered by LLMs have entered practical viability."

For firms handling mission-critical core systems for mid-market clients, this means that projects to "migrate core systems written in 20-year-old languages to modern languages" can now be executed at a realistic cost. As the ultimate form of the "language and editor generational shift" covered previously in our TypeScript 6 Migration Guide and Zed 1.0 Client Onboarding, "large-scale LLM language migrations" represent one of the largest markets for custom development. In this article, we outline how to design "large-scale LLM language migrations with business continuity," structured by phases, technology stacks, contract clauses, and pitfalls.

Why "large-scale LLM language migration" triggers explosive custom development demand among mid-sized enterprises

StructureManual migrationOSS transpilation toolsLarge-scale LLM migration (Claude Code)
Duration1–3 yearsSeveral months (partial only)Several weeks to months
CostHundreds of millions of yenTens of millions of yenTens of millions of yen (1/3 of manual)
Supported language pairsOptionalLimitedVirtually any
Business logic preservationManual review mandatoryEasily lostPreserved via test-driven workflows
Incidental refactoringSeparate effort requiredNot supportedExecutable concurrently
Documentation generationSeparate effort requiredNot supportedGeneratable concurrently
Risk upon failureProject cancellationStalled midway through partial migrationEarly detection via comprehensive test suites

In other words, the dilemma facing mid-market companies where "core systems written in 20-year-old languages cannot be touched" can now potentially be resolved on a timescale of months through "LLMs plus managed operations for clients."

Core insights from Bun's case study on "large-scale LLM language migration"

Insight 1: LLM migrations collapse without a comprehensive test suite

The Bun team possessed an extensive test suite covering their existing Zig codebase. They finished in 6 days because Rust code generated by LLMs could be instantly verified through tests. For core systems lacking comprehensive test coverage, work must begin with a phase dedicated to writing tests.

Insight 2: It is a "human + LLM team," not "an LLM writing alone"

In Bun's case as well, it was not that "an LLM wrote everything autonomously." Human engineers handled architecture, code review, and integration, while LLMs took on massive mechanical conversions. Designing division of labor is the key to success.

Insight 3: It is about "ensuring business continuity," not merely "replacing a language"

The hardest part of LLM migration is ensuring that business operations never halt during migration. Operational architecture for parallel running, shadow traffic, and phased cutovers matters even more than the underlying technology.

Five phases for designing "large-scale LLM language migration + business continuity"

Phase 1: Existing system audit and feasibility assessment (3–4 weeks)

We classify the client's existing systems by "language, scale (LOC), dependent libraries, test coverage, and business criticality." We draw clear boundaries between "untouchable sanctuaries" and "migratable domains."

Phase 2: Migration strategy formulation (2–3 weeks)

  • Target language selection (Rust, Go, TypeScript, Java, etc.)
  • Phased breakdown (by module, by feature, refactoring scope)
  • Test suite establishment plan
  • Parallel operation and cutover strategy
  • LLM cost estimation

Phase 3: Test suite development (4–8 weeks)

Establish characterization tests and golden master tests against the existing system. This is the most crucial phase as an absolute prerequisite for LLM migration.

Phase 4: LLM migration execution (4–12 weeks)

  • Assemble migration teams combining Claude Code, Codex, and Cursor
  • Module-by-module migration
  • Code review + passing tests → merge
  • Phased production release
  • Parallel operation and shadow traffic

Phase 5: Post-migration operations and knowledge transfer (ongoing)

Establish coding standards, CI pipelines, library management, and monitoring in the new language, and conduct knowledge transfer to the client's internal engineers.

Standard technology stack set for custom development

LayerRecommended technologyAlternative
LLM development assistanceClaude Code / Codex CLICursor
Test suiteCharacterization testing + property-based testingSnapshot testing
CIGitHub Actions + automated review botsJenkins / GitLab CI
Parallel operationFeature flags + shadow trafficBlue-green deployment
MonitoringOpenTelemetry + SentryDatadog
Code reviewAgent-generated PR reviewsManual only
Documentation generationAutomated LLM-driven ADR and README updatesManual

This can be viewed as a "cross-language counterpart" to the language upgrades covered in our TypeScript 6 Migration Guide. Furthermore, it only succeeds when paired with operational design for agent-generated PR reviews.

Which projects need this and which do not

Projects requiring thisProjects not requiring this
Core system written in a language from 10–30 years agoAlready written in modern languages
Hiring challenges with diminishing legacy-language engineersAbundant pool of legacy-language engineers
Cost of adding features increasing year after yearCost of adding features remains stable
Migrating while maintaining business continuityResources available for an all-at-once rewrite
Test suite partially existsZero automated tests

Six clauses to include in client contracts

ClauseDetailsWhat the client should verify
Target scopeModule / feature / whole systemFixed scope vs. phased expansion
Target languageRust, Go, TypeScript, etc.Impact on recruitment and training
Business logic assuranceGuaranteed via characterization testingAcceptance testing scope
Business continuity requirementsParallel operation / cutover strategyDowntime tolerance
LLM cost allocationCustom development vendor / client / split evenlyProjected LLM budget
Knowledge transferTraining for the client's internal teamSelf-sufficiency after custom development ends

Client-side ROI estimate (assuming legacy language 200k LOC / 40 million yen annual maintenance spend)

ItemWithout migrationPost-LLM migrationDifference
Annual maintenance and bug-fixing costs40 million yen15 million yen-25 million yen
Feature addition lead timeAverage 3 monthsAverage 1 month-2 months
Hiring and training costs12 million yen/year3 million yen/year-9 million yen
Incident recovery MTTRAverage 8 hoursAverage 2 hours-6h
Annual benefit (excluding migration cost)Approx. 38 million yen

This table represents an estimate strictly for cost reductions achieved after migration. Making a realistic investment decision requires deducting the costs incurred by the migration itself. Because migration expenditures fluctuate widely based on LOC scale, language pairs, test suite readiness, and continuity requirements, setting uniform baseline numbers is not meaningful. Frame the decision around "how many years of annual savings are required to recoup the migration investment," evaluating your company's actual maintenance and recruiting numbers against the scoped migration quote.

Five common pitfalls

Pitfall 1: Letting LLMs migrate code without a test suite

Having an LLM rewrite code without tests produces vast amounts of code that "runs, but behaves differently." Establishing a comprehensive test suite must always precede migration.

Pitfall 2: Delegating completely to LLMs and skipping human review

Bun's migration did not eliminate human review. Never bypass the three-tier framework: LLM writes → human reviews → tests validate.

Pitfall 3: Developing new features in parallel during migration

Continuously adding features to legacy code creates a maintenance nightmare where the delta against the new target codebase widens perpetually. Explicitly stipulate in contracts that new features are frozen during migration or require dual implementation.

Pitfall 4: Choosing a "big bang" cutover

Switching all modules simultaneously makes rollback impossible upon failure. Make feature flags and phased transitions mandatory.

Pitfall 5: Postponing knowledge transfer

If the client cannot maintain the new language once the custom development engagement ends, they remain permanently reliant on outsourcing. Incorporate internal engineer training alongside migration into agreements.

90-day action plan

WeekAction
Week 1〜4Existing system audit + feasibility assessment
Week 5〜7Migration strategy formulation
Week 8〜13Test suite establishment + starting migration from small modules

Summary — Solving "20-year-old languages" in months, even if 6 days is unrealistic

The Bun case study demonstrated an era where "large-scale LLM language migrations are achievable within realistic project timelines." For those entrusted with core systems at mid-market enterprises, moving beyond the binary choice of "freezing legacy languages in place or funding massive rewrites" makes planned modernization via "LLMs plus managed operations for clients" a viable option.

However, as detailed above, what governs the difficulty of migration is Phase 3, not Phase 4. Even within identical "200k LOC core systems," required timelines and team structures differ completely depending on whether characterization tests partially exist or are entirely missing. Until four factors are clarified—the state of the test suite, the language pair, the scope of untouchable legacy domains, and acceptable downtime during cutover—project timelines and costs remain purely theoretical numbers.

If your organization is experiencing concerns such as "mounting maintenance expenses for 20-year-old languages," "difficulty recruiting legacy-language engineers," or "wanting to explore LLM migrations but fearing failure," reach out through our inquiry form. We will start by collaborating on Phase 1 audits and feasibility evaluations, using discovered scope and test coverage realities to formulate a concrete project proposal.

Sources

Share this articleXFacebook
Kakeru Suzuki

Fascinated by the possibilities of technology, has had a deep interest in programming and digital art since student days

Turn this article's theme into your company's next step

Concrete steps forward for your organization.

We organize your desired architecture, legacy systems, and operational requirements to formulate your next steps toward execution.

  • Desired architecture
  • Integration with existing environments
  • Operational requirements
Consult on development & operations initiatives

You can consult with us from the initial conceptual stage. Details from this article will be carried over to the inquiry form.

Receive the latest articles by email