Open-Source Wikis

/

Bun

/

Fun facts

oven-sh/bun

Fun facts

A grab-bag of trivia gleaned while assembling this wiki. None of this is essential — it's just interesting.

  • The first commit message is literally woot (2021-04-17). Jarred Sumner.
  • src/css/css_parser.zig is the largest single Zig source file in the repo, at ~298 KB. It's also a port of Lightning CSS (originally Rust).
  • src/js_printer.zig is the second-largest, at ~260 KB. The printer is intentionally fat — most code-emission decisions live there rather than in transformations.
  • bun discord is two lines of code that open the Discord invite URL.
  • src/cli/add_completions.zig is ~301 KB — almost entirely a snapshot of popular npm package names for bun add shell completions.
  • The MIME type table (src/http/mime_type_list_enum.zig, ~256 KB) is generated from mime_type_list.txt.
  • The internal-module-registry-scanner.ts assigns numeric IDs to built-in modules in alphabetical order. Inserting a new file in src/js/node/ shifts every later module's ID, but the scanner regenerates so consumers don't notice.
  • The $ prefix in src/js/ files is rewritten to __intrinsic__ during preprocessing, then to @ before the JSC builtin compiler sees it. Three names for the same concept depending on which tool's view you're in.
  • bun.report URLs are actually pretty long — the encoded payload contains a full demangled stack trace, register state, and source-map indexes. The decoder runs server-side at bun.report and shows a human page.
  • The repo's "robobun" account has 730 commits in the last year — more than any human. It's the bot that handles version bumps and CI signal.
  • Bun has its own line editor for the REPL (src/repl.zig, ~67 KB). No GNU readline dependency. Yes, it has tab completion.
  • The --print / -p flag wraps the input in a console.log(...). The -e flag doesn't. They're otherwise the same code path.
  • Bun.spawnSync runs a child process synchronously without parking the JS event loop. It uses a separate SpawnSyncEventLoop (src/bun.js/event_loop/SpawnSyncEventLoop.zig) that ticks only the I/O backing the child's pipes.
  • Bun ships its own HTTP/3 client (lsquic + lsqpack) but not yet an HTTP/3 server (work in progress as of 1.3).
  • The crash handler turns OOM into a bun.report-shaped crash with a real backtrace. bun.handleOom(...) is the project-standard way to call allocators.
  • WebKit/JSC swaps host and hostname semantics relative to JS — url.host() returns hostname without port, url.hostname() returns hostname with port. Documented in src/CLAUDE.md precisely because it's a footgun.
  • src/bun.js/api/Glob.classes.ts plus src/bun.js/api/glob.zig is the canonical "small JS class" pair to look at if you want to understand the codegen pipeline. The C++ side is fully generated.
  • The shell (Bun.$, src/shell/) is its own POSIX-shell-ish parser-interpreter, not a wrapper around /bin/sh. It runs identically on Windows.
  • The branch-name gate (claude/) is real — CI ignores branches without that prefix.
  • bun-types/ is a separate npm-published package (bun-types) for users who want Bun's globals available in TS without installing Bun itself.
  • BunDebugger.cpp and BunInspector.cpp are mostly thin wrappers around JSC's standard inspector protocol — Chrome DevTools attaches to bun --inspect with no special protocol.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Fun facts – Bun wiki | Factory