YouTube Summaries

← All summaries

Teaching jai-ctags to emit Emacs ETAGS

2026-06-13 Sat ⏱ 1 hr 20 min @TsodingDaily

Live recreational-programming stream: Tsoding extends Rafael Luba's `jai-ctags` (a Jai library that generates Vim-compatible CTags from the compiler's type-checking messages) to also emit the ETAGS format that Emacs uses, so he can jump-to-definition in his own Jai projects.

CTags is a "primordial LSP" — a table mapping names to file locations. `jai-ctags` only emits the Vim CTags format; Emacs wants the different ETAGS format, so Tsoding adds it. Along the way he marvels at Jai's build model: your build script runs an event loop polling compiler messages, and on each type-checked function you receive the literal AST (code block, statement array) and can inspect or even inject code — "you become part of the compiler" (he jokes Jonathan Blow will hate the stream for hyping the still-rough compiler).

He reads the SourceForge CTags-format spec (riffing that SourceForge now loads faster than GitHub), discovers the tag address can be a literal Ex command, and builds the ETAGS output (section format: `\x0c`, then `text\x7f tag\x01 line,byteoffset`) with a file builder. The payoff: it works first try, and Emacs `xref` jump-to-definition succeeds — even though his computed byte offset is wrong, suggesting Emacs ignores the offset and uses the line/text. Good enough for his project; he won't bother PRing since Luba is busy on the game. Closing chat: he lowered his stream bitrate 6K→4K (the real cause of his VPN streaming drops), and muses about Boosty donations being awkward for his US/EU audience.