// EMACS-ARB — ENGINEERING REPORT

Emacs major mode for arb · font-lock for keywords, widgets, query verbs, paths, /regex/ · run via arb · LSP via arb --lsp (eglot + lsp-mode) · verified with batch face assertions

>_EXECUTIVE SUMMARY

emacs-arb is the Emacs major mode for arb — a Tcl/Tk-flavored declarative language for visualizing and modifying Unix pipelines, on the fusevm bytecode VM + Cranelift JIT. arb-mode derives from prog-mode and provides font-lock, a syntax table, brace-aware indentation, filetype detection, a buffer runner (arb FILE via compile), eldoc + completion for the query verbs, and an LSP client that launches arb --lsp.

Design principle: the highlighted surface is arb's actual language surface — keywords, the widgets, the query verbs, input sources, directives, dotted widget paths, and /regex/ literals. Because arb has a finite corpus (a few hundred verbs / widgets / directives, unlike the sibling stryke with its ~10,450 generated builtins), the lists are plain regexp-opt alternations in arb-mode.el; no generated hash-table stdlib is required.

18
Widgets
130+
Query verbs
10
Input sources
.a.b
Widget paths
2
LSP clients (eglot + lsp-mode)
2
Detection paths (ext + shebang)
13
Face assertions
27.1
Min Emacs version

~WHY NO GENERATED STDLIB

The sibling emacs-stryke generates a 170 KB stryke-stdlib.el of hash tables because a single regexp-opt over stryke's ~10,450 builtins overflows Emacs' regexp compiler (invalid-regexp "Regular expression too big"). arb has no such problem: its corpus — the widgets, ~130 query verbs, input sources, directives, and keywords — is comfortably within the regexp-size limit. So arb-mode.el uses plain regexp-opt alternations, and arb-stdlib.el holds the query-verb / widget signatures used for eldoc and completion-at-point. Dotted widget paths (.codes) and /regex/ literals (which division a / b must not be mistaken for) are matched with a dedicated regexp and a syntax-propertize rule that only fires in operand position.

ComponentDetail
arb-mode.elMajor mode — syntax table (# comments, single/double string quotes, / as punctuation), font-lock keyword / widget / verb lists, /regex/ syntax-propertize, arb-indent-line, arb-run-buffer (C-c C-c), eldoc + completion, eglot + lsp-mode registration, auto-mode-alist + interpreter-mode-alist.
arb-stdlib.elQuery-verb / widget / directive signatures (from arb's LSP corpus) for eldoc and completion. Byte-compiles cleanly; loads instantly.
scripts/face-test.elFontify a sample spec and assert the face at each probe token.
arb --lspLaunched with only --lsp; an appended --stdio is rejected by the binary, so neither client adds one.

$VERIFICATION

CI byte-compiles the package with byte-compile-error-on-warn (warnings are errors) and runs the batch face test. Each probe asserts the actual face text-property after font-lock-ensure.

Sample tokenAsserted face
text / gaugearb-widget-face
source / out / bind / fnfont-lock-keyword-face
where / field / tally / countfont-lock-builtin-face
in.jsonfont-lock-type-face
quit (action)font-lock-type-face
pct (user function name)font-lock-function-name-face