Zero to running a polymorphic gawk program. Real prompts, real output, copy-pastable.
$ brew install gawk # macOS $ sudo apt install gawk # debian/ubuntu
$ curl -sL https://raw.githubusercontent.com/timm/awk/master/dot/dot -o dot $ chmod +x dot $ ./dot --demo hello n=5 mean=30.000
One file. Bundles the preprocessor, runtime, and helpers as heredocs.
No objects yet — just the preprocessor's two rules:
$ cat > tour1.awk <<'EOF'
BEGIN { .me.name = "tim"; .me.job = "prof"
print .me.name, .me.job }
EOF
$ ./dot -c tour1.awk BEGIN { HEAP[me]["name"] = "tim"; HEAP[me]["job"] = "prof" print HEAP[me]["name"], HEAP[me]["job"] }
Two rules: .me.name → HEAP[me]["name"]; bare .me → HEAP[me].
$ ./dot tour1.awk tim prof
The dot binary preprocesses the file in a tempdir, then gawk -f's it for you.
A running mean using new() from dot's runtime:
$ cat > tour2.awk <<'EOF' BEGIN { N = new("plain") } { .N.n++; .N.mu += ($1 - .N.mu) / .N.n } END { printf "n=%d mean=%.2f\n", .N.n, .N.mu } EOF $ printf "10\n20\n30\n40\n50\n" | ./dot tour2.awk n=5 mean=30.00
What happened: new("plain") allocated ID 1, set HEAP[1]["is"]="plain". Each row updated .N.n and .N.mu. END printed them. No type system needed — just struct sugar over HEAP.
Example — hello.awk walkthrough with pre/post rewrite tables.
Tests — annotated test suite, doubles as 26 mini usage snippets.
Manual — preprocessor rules, runtime API, conventions, limitations.
dotcols — Num/Sym/Data column types on top of dot.
dotlearn — ML on top of dotcols: trees, naive Bayes, active learning.