Two requirements: gawk and bash.
| Tool | Version | Why |
|---|---|---|
gawk | ≥ 4.x | indirect calls (@fn), FUNCTAB, SYMTAB, asorti |
bash | ≥ 4.x | arrays, process substitution <(...) |
Note on gawk 5.4.0: the preprocessor avoids gensub(...,"g") due to a bug where the second match's captures come back empty. A match/substr loop is used instead.
brew install gawk # macOS
sudo apt install gawk # debian/ubuntu
sudo dnf install gawk # fedora
Default /bin/sh on macOS is bash 3.x — too old for <(...). Run dot from bash or zsh, not sh.
One file, ~180 lines. The dot binary is a self-contained bash script with the preprocessor, runtime, and helper library bundled inside as heredocs. No directory. No Makefile.
curl -sL https://raw.githubusercontent.com/timm/awk/master/dot/dot -o dot && chmod +x dot
Or onto your PATH:
curl -sL https://raw.githubusercontent.com/timm/awk/master/dot/dot -o ~/.local/bin/dot && chmod +x ~/.local/bin/dot
One command. Bundled --hello demo runs running-mean over five numbers:
./dot --demo hello
Expect:
n=5 mean=30.000
If you see that, the preprocessor, runtime, and helper library are all working.
dot FILE.awk [DATA...] # run rewritten FILE.awk on DATA (or stdin)
dot a.awk b.awk DATA # multi-file run; .awk args go through prep
cat DATA | dot FILE.awk # stdin works too
dot -c FILE.awk # print rewritten source only
dot --demo NAME [DATA] # run demos/NAME/*.awk on DATA (or sample.*)
dot --demos # list available demos under ./demos/
dot --show # dump bundled lib/*.awk (post-prep)
dot --help # full help
dot ships only the preprocessor, the runtime (new, arr, zap) and helpers (rogues, o, _oo) — plus the hello demo. For Num/Sym column types, the Data CSV table, and a curated example-data fetcher, install dotcols. For ML on top, install dotlearn.
git clone https://github.com/timm/awk
cd awk/dot
./build.sh # rebuild the dot binary from sources
The repo contains the modular sources (lib/prep.awk, lib/dot.awk, lib/dotlib.awk) plus the demos/hello/ example and build.sh, which assembles them into the single-file dot binary. Edit a source file, run ./build.sh, get a rebuilt dot.