Why Bun AOT compiles from .ts source: d.ts type declarations aren't enough
MarcJSchmidt · x · 2026-10-10
Bun creator Jarred Sumner notes that to maximize AoT's performance edge over JIT, Bun must compile from source .ts files instead of .d.ts declarations. MarcJSchmidt elaborates:
- TSC has an analysis budget, so it can't fully unfold inferred types and generics into ideal concrete instantiations (that would blow up analysis time and space); d.ts is only a "good enough" representation. A slow type-inference engine yields "good enough" rather than optimal function instantiations, wasting JIT/AoT potential.
- Caller overhead: without reducing functions to minimal concrete instantiations, both caller and callee pay heavy overhead — something he learned building TypeRunner years ago.
More from coding & agent
- Three plugins to squeeze more token savings out of the Pi coding agent — solyarisoftware · 2026-10-10
- AI-Generated Proposals Are Making Reviewers Work Harder Than the Authors — yangyi · 2026-10-10
- "Superintelligence at $5/Task, But AI Mods Still Suck" — Devs Complain — Aryvyo · 2026-10-10
- TokenMaster launches: a prettier ccusage-style AI token usage tracker — cneuralnetwork · 2026-10-10
- Matt Pocock: Turn Repeated Tasks into CLI + Skills Agents Own to Cut Tokens and Hallucinations — mattpocockuk · 2026-10-10
- Claude Opus 5.5 Designs a Machine That Builds Machines, Producing a Working Relay in 27 Layers — dosco · 2026-10-10