<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Zig on ICE-ICE-BEAR-BLOG</title><link>https://ice-ice-bear.github.io/tags/zig/</link><description>Recent content in Zig on ICE-ICE-BEAR-BLOG</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Wed, 06 May 2026 00:00:00 +0900</lastBuildDate><atom:link href="https://ice-ice-bear.github.io/tags/zig/index.xml" rel="self" type="application/rss+xml"/><item><title>Bun Is Being Ported From Zig to Rust — A 30KB PORTING.md That Claude Follows</title><link>https://ice-ice-bear.github.io/posts/2026-05-06-bun-zig-to-rust-porting/</link><pubDate>Wed, 06 May 2026 00:00:00 +0900</pubDate><guid>https://ice-ice-bear.github.io/posts/2026-05-06-bun-zig-to-rust-porting/</guid><description>&lt;img src="https://ice-ice-bear.github.io/" alt="Featured image of post Bun Is Being Ported From Zig to Rust — A 30KB PORTING.md That Claude Follows" /&gt;&lt;h2 id="overview"&gt;Overview
&lt;/h2&gt;&lt;p&gt;The JavaScript runtime &lt;a class="link" href="https://bun.com" target="_blank" rel="noopener"
 &gt;Bun&lt;/a&gt; has a suspiciously named branch on its GitHub repo &lt;a class="link" href="https://github.com/oven-sh/bun" target="_blank" rel="noopener"
 &gt;oven-sh/bun&lt;/a&gt; called &lt;a class="link" href="https://github.com/oven-sh/bun/tree/claude/phase-a-port" target="_blank" rel="noopener"
 &gt;&lt;code&gt;claude/phase-a-port&lt;/code&gt;&lt;/a&gt;. Inside it lives &lt;a class="link" href="https://github.com/oven-sh/bun/blob/claude/phase-a-port/docs/PORTING.md" target="_blank" rel="noopener"
 &gt;&lt;code&gt;docs/PORTING.md&lt;/code&gt;&lt;/a&gt;, a 30KB+ guide that translates Bun&amp;rsquo;s &lt;a class="link" href="https://ziglang.org/" target="_blank" rel="noopener"
 &gt;Zig&lt;/a&gt; codebase into &lt;a class="link" href="https://www.rust-lang.org/" target="_blank" rel="noopener"
 &gt;Rust&lt;/a&gt; one file at a time — a complete type map, idiom map, and crate map. The &lt;code&gt;claude/&lt;/code&gt; prefix is the giveaway: this is almost certainly being driven by &lt;a class="link" href="https://www.anthropic.com/claude-code" target="_blank" rel="noopener"
 &gt;Anthropic&amp;rsquo;s Claude Code&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="mermaid" style="visibility:hidden"&gt;flowchart LR
 Zig[".zig source tree"] --&gt; PhaseA["Phase A &amp;lt;br/&amp;gt; emit .rs next to .zig &amp;lt;br/&amp;gt; compilation NOT required"]
 Guide["docs/PORTING.md &amp;lt;br/&amp;gt; type/idiom/crate map"] --&gt; PhaseA
 Lifetimes["docs/LIFETIMES.tsv &amp;lt;br/&amp;gt; per-field ownership class"] --&gt; PhaseA
 PhaseA --&gt; Markers["// TODO(port) &amp;lt;br/&amp;gt; // PERF(port) &amp;lt;br/&amp;gt; // PORT NOTE"]
 Markers --&gt; PhaseB["Phase B &amp;lt;br/&amp;gt; crate-by-crate compile &amp;lt;br/&amp;gt; one grep handles each marker"]
 PhaseB --&gt; Rust["bun_str / bun_sys &amp;lt;br/&amp;gt; bun_jsc / bun_uws &amp;lt;br/&amp;gt; bun_alloc / bun_bundler"]&lt;/pre&gt;&lt;h2 id="what-was-found"&gt;What Was Found
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/oven-sh/bun" target="_blank" rel="noopener"
 &gt;oven-sh/bun&lt;/a&gt; (89K+ stars, &amp;ldquo;Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one&amp;rdquo;) has a live &lt;a class="link" href="https://github.com/oven-sh/bun/tree/claude/phase-a-port" target="_blank" rel="noopener"
 &gt;&lt;code&gt;claude/phase-a-port&lt;/code&gt;&lt;/a&gt; branch.&lt;/li&gt;
&lt;li&gt;It contains &lt;a class="link" href="https://github.com/oven-sh/bun/blob/claude/phase-a-port/docs/PORTING.md" target="_blank" rel="noopener"
 &gt;&lt;code&gt;docs/PORTING.md&lt;/code&gt;&lt;/a&gt;, a 1:1 Zig-to-Rust translation guide. Tens of thousands of lines, with complete type maps, idiom maps, and crate maps.&lt;/li&gt;
&lt;li&gt;Phase A&amp;rsquo;s goal is precise: &lt;strong&gt;&amp;ldquo;a draft &lt;code&gt;.rs&lt;/code&gt; lands next to each &lt;code&gt;.zig&lt;/code&gt;. Compilation is NOT required. Logic must be faithful.&amp;rdquo;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Phase B is where everything is forced through the compiler, crate by crate.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="why-it-matters"&gt;Why It Matters
&lt;/h2&gt;&lt;p&gt;Bun is the &lt;strong&gt;largest infrastructure project ever built in &lt;a class="link" href="https://ziglang.org/" target="_blank" rel="noopener"
 &gt;Zig&lt;/a&gt;&lt;/strong&gt;: runtime, bundler, package manager all in one binary, with a single domain at &lt;a class="link" href="https://bun.com" target="_blank" rel="noopener"
 &gt;bun.com&lt;/a&gt;. Zig still ships frequent 0.x breakage and is generally seen as not-yet-stable on ABI and language semantics. The biggest codebase on top of it deciding to port to Rust is itself an &lt;strong&gt;industry signal&lt;/strong&gt;. Zig-to-Rust is not the usual direction.&lt;/p&gt;
&lt;p&gt;And the branch name is the tell. No human team names a working branch &lt;code&gt;claude/phase-a-port&lt;/code&gt;. That&amp;rsquo;s the shape of &amp;ldquo;hand phase A to the &lt;a class="link" href="https://www.anthropic.com/claude-code" target="_blank" rel="noopener"
 &gt;Claude Code&lt;/a&gt; agent and watch.&amp;rdquo;&lt;/p&gt;
&lt;h2 id="inside-the-guide"&gt;Inside the Guide
&lt;/h2&gt;&lt;h3 id="ground-rules"&gt;Ground rules
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;Each &lt;code&gt;.rs&lt;/code&gt; lives in the same directory and has the same basename as its &lt;code&gt;.zig&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Cross-area types are referenced as &lt;code&gt;bun_&amp;lt;area&amp;gt;::Type&lt;/code&gt; (Cargo.toml wireup happens in Phase B).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Forbidden&lt;/strong&gt;: tokio, rayon, hyper, async-trait, futures, &lt;code&gt;std::fs&lt;/code&gt;/&lt;code&gt;net&lt;/code&gt;/&lt;code&gt;process&lt;/code&gt;. Bun has its own event loop and goes straight to syscalls.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Forbidden&lt;/strong&gt;: &lt;code&gt;async fn&lt;/code&gt;. Everything is a callback plus state machine.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;unsafe&lt;/code&gt; is OK wherever Zig was unsafe. Every &lt;code&gt;unsafe&lt;/code&gt; block needs &lt;code&gt;// SAFETY: &amp;lt;why&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;If unsure, leave a &lt;code&gt;// TODO(port): &amp;lt;reason&amp;gt;&lt;/code&gt;.&lt;/strong&gt; A flag beats a guess.&lt;/li&gt;
&lt;li&gt;Zig perf idioms (&lt;code&gt;appendAssumeCapacity&lt;/code&gt;, arena bulk-free, comptime monomorphization) become plain Rust with a &lt;code&gt;// PERF(port): ...&lt;/code&gt; comment, then Phase B greps and benches them.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="crate-map-excerpt"&gt;Crate map (excerpt)
&lt;/h3&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Zig namespace&lt;/th&gt;
 &lt;th&gt;Rust crate&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.String&lt;/code&gt;, &lt;code&gt;bun.strings&lt;/code&gt;, &lt;code&gt;ZigString&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_str&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.sys&lt;/code&gt;, &lt;code&gt;bun.FD&lt;/code&gt;, &lt;code&gt;Maybe(T)&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_sys&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.jsc&lt;/code&gt;, &lt;code&gt;JSValue&lt;/code&gt;, &lt;code&gt;JSGlobalObject&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_jsc&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.uws&lt;/code&gt;, &lt;code&gt;us_socket_t&lt;/code&gt;, &lt;code&gt;Loop&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_uws_sys&lt;/code&gt; / &lt;code&gt;bun_uws&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.allocators&lt;/code&gt;, &lt;code&gt;MimallocArena&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_alloc&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.shell&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_shell&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.bake&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_bake&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.install&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_install&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;bun.bundle_v2&lt;/code&gt;, &lt;code&gt;Transpiler&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;bun_bundler&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;MimallocArena&lt;/code&gt; is an arena allocator built on top of &lt;a class="link" href="https://github.com/microsoft/mimalloc" target="_blank" rel="noopener"
 &gt;mimalloc&lt;/a&gt;; &lt;code&gt;bun.uws&lt;/code&gt; is Bun&amp;rsquo;s own event loop binding (uSockets). Critically, neither uses an async runtime like &lt;a class="link" href="https://tokio.rs/" target="_blank" rel="noopener"
 &gt;tokio&lt;/a&gt; — and the porting guide forbids one explicitly.&lt;/p&gt;
&lt;h3 id="type-map-excerpt"&gt;Type map (excerpt)
&lt;/h3&gt;&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Zig&lt;/th&gt;
 &lt;th&gt;Rust&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;[]const u8&lt;/code&gt; (struct field)&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;&lt;code&gt;Box&amp;lt;[u8]&amp;gt;&lt;/code&gt; / &lt;code&gt;Vec&amp;lt;u8&amp;gt;&lt;/code&gt; / &lt;code&gt;&amp;amp;'static [u8]&lt;/code&gt; / arena raw ptr&lt;/strong&gt; — decide by reading &lt;code&gt;deinit&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;[:0]const u8&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;&amp;amp;ZStr&lt;/code&gt; (length-carrying NUL-terminated)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;?T&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;Option&amp;lt;T&amp;gt;&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;anyerror!T&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;Result&amp;lt;T, bun_core::Error&amp;gt;&lt;/code&gt; (always, in Phase A)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;comptime T: type&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;&amp;lt;T&amp;gt;&lt;/code&gt; (generic + trait bound)&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;comptime n: uN&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;&amp;lt;const N: uN&amp;gt;&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;inline for&lt;/code&gt; over tuple&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;const [T; N]&lt;/code&gt; + &lt;code&gt;for&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;for (slice, 0..) |x, i|&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;for (i, x) in slice.iter().enumerate()&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;defer x.deinit()&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;delete&lt;/strong&gt; — handled implicitly by &lt;code&gt;impl Drop&lt;/code&gt;&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;errdefer alloc.free(x)&lt;/code&gt; (just-built local)&lt;/td&gt;
 &lt;td&gt;&lt;strong&gt;delete&lt;/strong&gt; — &lt;code&gt;?&lt;/code&gt; drops it for you&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;&lt;code&gt;errdefer { side effects }&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;&lt;a class="link" href="https://docs.rs/scopeguard/" target="_blank" rel="noopener"
 &gt;&lt;code&gt;scopeguard::guard(...)&lt;/code&gt;&lt;/a&gt; and disarm on the success path&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="notable-micro-rules"&gt;Notable micro-rules
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;code&gt;bun_core::Error&lt;/code&gt; is &lt;strong&gt;&lt;code&gt;#[repr(transparent)] NonZeroU16&lt;/code&gt;&lt;/strong&gt; — a heap-free Copy-able error newtype with a link-time-registered name table. &lt;code&gt;anyhow::Error&lt;/code&gt; and &lt;code&gt;Box&amp;lt;dyn Error&amp;gt;&lt;/code&gt; are banned because of heap allocation, lack of &lt;code&gt;Copy&lt;/code&gt;, and broken &lt;code&gt;@errorName&lt;/code&gt; snapshot compatibility.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;bun.Wyhash11&lt;/code&gt; is &lt;strong&gt;kept distinct from &lt;code&gt;std.hash.Wyhash&lt;/code&gt; (seed 0) for on-disk compatibility.&lt;/strong&gt; Lockfiles, npm manifest cache, and integrity all depend on it — the Rust port keeps the separate implementation.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;defer pool.put(x)&lt;/code&gt; becomes a Drop-guard pattern in Rust. &lt;strong&gt;Manual defer is forbidden.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;scopeguard::guard((), \|_\| ...)&lt;/code&gt; &amp;ldquo;unit state&amp;rdquo; pattern is &lt;strong&gt;forbidden&lt;/strong&gt; — it usually means a missing RAII type.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;@errorName(e)&lt;/code&gt; becomes an &lt;code&gt;IntoStaticStr&lt;/code&gt; derive. &lt;strong&gt;Never &lt;code&gt;Display&lt;/code&gt; or &lt;code&gt;format!(&amp;quot;{e:?}&amp;quot;)&lt;/code&gt;&lt;/strong&gt; — JS &lt;code&gt;error.code&lt;/code&gt;, snapshot tests, and crash-handler traces depend on the exact string.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;for (a, b) \|x, y\|&lt;/code&gt; becomes &lt;code&gt;for (x, y) in a.iter().zip(b)&lt;/code&gt; plus a &lt;strong&gt;&lt;code&gt;debug_assert_eq!(a.len(), b.len())&lt;/code&gt;&lt;/strong&gt;. Zig asserts; Rust&amp;rsquo;s &lt;code&gt;zip&lt;/code&gt; silently truncates.&lt;/li&gt;
&lt;li&gt;TLS code stays on &lt;a class="link" href="https://boringssl.googlesource.com/boringssl/" target="_blank" rel="noopener"
 &gt;BoringSSL&lt;/a&gt; via FFI — not rewritten as pure-Rust RustTLS.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="phase-a-vs-phase-b"&gt;Phase A vs Phase B
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Phase A&lt;/strong&gt; = one &lt;code&gt;.zig&lt;/code&gt; → one &lt;code&gt;.rs&lt;/code&gt;. Doesn&amp;rsquo;t have to compile. Logic faithful, idiomatic Rust shape.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Phase B&lt;/strong&gt; = crate-by-crate compile pass. Sweep &lt;code&gt;// TODO(port)&lt;/code&gt; and &lt;code&gt;// PERF(port)&lt;/code&gt; markers in batch.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This split is the load-bearing piece. Try to do everything at once and the LLM&amp;rsquo;s context collapses; carve it into one-zig-to-one-rs units and a single session can finish one. Compilation correctness is deferred entirely to Phase B.&lt;/p&gt;
&lt;h2 id="what-this-means--agent-skills-in-production"&gt;What This Means — agent-skills, In Production
&lt;/h2&gt;&lt;p&gt;The PORTING.md document itself is the interesting artifact.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;A guide written by humans for an LLM to follow.&lt;/strong&gt; Producing a 30KB+ map up front isn&amp;rsquo;t &amp;ldquo;Claude, port this for me&amp;rdquo; — it&amp;rsquo;s &amp;ldquo;&lt;strong&gt;Claude, here&amp;rsquo;s exactly what to translate to what&lt;/strong&gt;.&amp;rdquo; It&amp;rsquo;s the &lt;a class="link" href="https://www.anthropic.com/news/skills" target="_blank" rel="noopener"
 &gt;agent-skills&lt;/a&gt; idea applied in production.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Type-by-type decisions are nailed down in advance.&lt;/strong&gt; Whether &lt;code&gt;[]const u8&lt;/code&gt; (as a struct field) becomes &lt;code&gt;Box&amp;lt;[u8]&amp;gt;&lt;/code&gt; or &lt;code&gt;&amp;amp;'static [u8]&lt;/code&gt; is not left to the LLM&amp;rsquo;s judgment — there&amp;rsquo;s a meta-rule (&amp;ldquo;look at &lt;code&gt;deinit&lt;/code&gt;&amp;rdquo;) that forces the decision.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;A &lt;code&gt;docs/LIFETIMES.tsv&lt;/code&gt; file&lt;/strong&gt; is referenced explicitly: per-field OWNED / SHARED / BORROW_PARAM / STATIC / JSC_BORROW / BACKREF / INTRUSIVE / FFI / ARENA / UNKNOWN classes pre-classified by hand. The LLM is told to copy that column verbatim. &lt;strong&gt;The cross-file analysis is precomputed and handed to the model.&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Three markers (&lt;code&gt;PORT NOTE&lt;/code&gt;, &lt;code&gt;TODO(port)&lt;/code&gt;, &lt;code&gt;PERF(port)&lt;/code&gt;)&lt;/strong&gt; are the phase handoff. Whoever (or whichever future LLM session) picks up Phase B can &lt;code&gt;grep&lt;/code&gt; once and have a queue of work.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="insights"&gt;Insights
&lt;/h2&gt;&lt;p&gt;This is the first publicly visible attempt to migrate a major codebase between systems languages using LLM automation, and the interesting takeaway is that &lt;strong&gt;the leverage is in the guide, not the model.&lt;/strong&gt; PORTING.md pre-decides type maps and idiom maps, LIFETIMES.tsv pre-decides ownership per field, and TODO/PERF/PORT NOTE markers pre-design the phase-to-phase handoff. The LLM is intentionally left no room to be creative — it just executes &amp;ldquo;this line becomes that line.&amp;rdquo; Banning tokio, rayon, async-trait, and the rest of the canonical Rust async stack reflects the same instinct: Bun has its own event loop and FFI assets like &lt;a class="link" href="https://boringssl.googlesource.com/boringssl/" target="_blank" rel="noopener"
 &gt;BoringSSL&lt;/a&gt; that an LLM &amp;ldquo;Rust-ifying&amp;rdquo; would silently break. PORTING.md may end up the &lt;strong&gt;textbook example&lt;/strong&gt; of an LLM-driven port. If massive codebase migrations become economically tractable as LLM spend, the deciding cost factor isn&amp;rsquo;t going to be GPUs or model choice — it&amp;rsquo;s going to be &lt;strong&gt;how much guide you wrote before you pressed Run.&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="references"&gt;References
&lt;/h2&gt;&lt;h3 id="bun-and-the-porting-branch"&gt;Bun and the porting branch
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://bun.com" target="_blank" rel="noopener"
 &gt;Bun homepage&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/oven-sh/bun" target="_blank" rel="noopener"
 &gt;oven-sh/bun GitHub repo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/oven-sh/bun/tree/claude/phase-a-port" target="_blank" rel="noopener"
 &gt;&lt;code&gt;claude/phase-a-port&lt;/code&gt; branch&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/oven-sh/bun/blob/claude/phase-a-port/docs/PORTING.md" target="_blank" rel="noopener"
 &gt;&lt;code&gt;docs/PORTING.md&lt;/code&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="languages-and-ecosystems"&gt;Languages and ecosystems
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://ziglang.org/" target="_blank" rel="noopener"
 &gt;Zig language&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://www.rust-lang.org/" target="_blank" rel="noopener"
 &gt;Rust language&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://www.anthropic.com/claude-code" target="_blank" rel="noopener"
 &gt;Anthropic Claude Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://www.anthropic.com/news/skills" target="_blank" rel="noopener"
 &gt;Anthropic agent-skills announcement&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="tooling--crates-referenced"&gt;Tooling / crates referenced
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;&lt;a class="link" href="https://docs.rs/scopeguard/" target="_blank" rel="noopener"
 &gt;scopeguard crate&lt;/a&gt; — RAII guard standing in for &lt;code&gt;errdefer&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://github.com/microsoft/mimalloc" target="_blank" rel="noopener"
 &gt;mimalloc&lt;/a&gt; — backing allocator for &lt;code&gt;MimallocArena&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://boringssl.googlesource.com/boringssl/" target="_blank" rel="noopener"
 &gt;BoringSSL&lt;/a&gt; — TLS dependency kept on FFI&lt;/li&gt;
&lt;li&gt;&lt;a class="link" href="https://tokio.rs/" target="_blank" rel="noopener"
 &gt;tokio&lt;/a&gt; — async runtime explicitly forbidden in Phase A&lt;/li&gt;
&lt;/ul&gt;</description></item></channel></rss>