Skip to content

How is dog different?

Left: dog in 1.1s, right: bat in 6.9s — printing the same 260,493-line C file.

Left: dog in 1.1s, right: bat in 6.9s — printing the same 260,493-line C file.

How dog compares to bat, side by side: the parsing engine, theming, languages, syntax coverage, speed, binary size, and platforms — plus what 0.1 doesn't do yet, and when each tool is the right pick.

Engine

dog parses files into a full AST and queries the tree. bat matches regex patterns per line.

dogbat
Parsertree-sitterregex
Librarytree-sitter C APIsyntect
Grammarsnvim-treesitterSublime Text
AST accessYesNo

The AST row matters twice. Today, it's why dog colors 100% of the code while regex misses tokens — see Coverage below. Down the line, it could enable features regex can't do — like printing a single function from a file, or diffs that understand code structure. Nothing like that ships in 0.1, and none of it is promised — it's just room the engine leaves to grow.

Themes

Themes: Catppuccin Frappé, Vim Adwaita Dark, Tokyo Night, built-in --light.

Themes: Lotus Light, the built-in --light, Vim Light, Catppuccin Latte.

dog reads plain Zed JSON themes — drop a .json in your theme directory and it shows up. bat reads complex TextMate XML, popularized by the Sublime Text editor released in 2008. Because Zed themes carry editor UI info, dog can theme parts of the output that bat can't, per theme: the code background, line-number color, gutter background, and border line, plus bold and italic per token (4 font variants). Alpha channels are supported by compositing against the editor background at load time.

dogbat
FormatZed JSONTextMate XML
Code backgroundThemedTerminal
Line number fgThemedFixed
Gutter bgThemedFixed
Border / gutter lineThemedFixed
Bold & italic (all 4 font styles)Theme-controlledPartial — italics opt-in, never combined
Alpha colorsYesNo
Multi-variant bundlesYesNo
Use editor theme dir--theme-dirNo

For the schema, bundled themes, and how to point dog at an existing Zed themes directory, see Theming.

Languages

dogbat
Count17200+
Build-time subsetYesNo

Supported language list: Configuration → Supported languages, with more planned.

Coverage

Coverage is how much of the code actually gets a syntax color — whatever isn't covered prints as plain, uncolored text. dog colors 100% in every language; bat averages 77% (measured 2026-07-18):

dogbat
Average coverage100%77%
Languages won15/170/17
Languages tied2/172/17

Comparing language by language: dog scores higher in 15 of the 17, and the other two (JSON and YAML) are ties where bat also reaches full coverage. Per-language breakdown and methodology: Benchmarks → Coverage.

Speed

Paired hyperfine runs, both tools on Catppuccin Mocha, pager off, auto-detected language (measured 2026-07-18):

SizeAvg linesdog winsAvg ratio
tiny3017/172.8×
small19517/173.5×
medium2,17517/176.0×
large16,90017/177.4×
extreme157,7402/28.0×

dog wins every language at every size. Every language starts up in ~5ms — precompiled highlight queries removed the startup cost that used to let bat win small files. In a previewer like fzf or yazi, that's the latency on every keystroke.

Full matrix and methodology: Benchmarks.

Binary size

dogbat
macOS~20 MB~5 MB
Linux~34 MB~7 MB
Runtime depsNoneNone

Most of the size is the 17 tree-sitter grammars compiled directly into the binary. Building from source, you can pick just the languages you need and shrink it — a Swift+JSON-only build is ~5 MB on macOS. The Linux binary is bigger because it also carries the whole Swift runtime — that's what buys the "None" in the runtime-deps row: it runs on a bare distro with nothing to install first.

Platforms

dogbat
macOSYesYes
LinuxYesYes
WindowsNoYes

Missing from dog in 0.1

  • Multi-file rendering (one file at a time for now)
  • Git-diff gutter
  • Windows support
  • Piping multiple files as one stream
  • Configurable pager (dog pipes to less -R directly)
  • Line range output

What's next

dog is stable at 0.1 but still a puppy. We don't anticipate breaking changes, but it is in active development. Nothing here is a promise and there are no dates — these are the things most likely to get explored and added, in no particular order:

  • Line range output
  • Line highlighting
  • Headers / footers
  • TOML config file — set your defaults without flags
  • More languages
  • Alternative pagers — $PAGER support
  • Git integration — gutter marks, status
  • man + --help highlighting

When to use which

Stick with bat if you need 200+ languages, you're on Windows, you rely on git-gutter, or binary size matters for your setup (embedded systems).

Try dog as an alternative to cat or bat, or if you want richer previews in other tools like fzf, tv, or yazi. Or if you care about speed (especially for large files), Swift, or tree-sitter.