Open Source
Wawk — AWK, Extended
Wawk extends AWK — the classic pattern-scanning and text-processing language created at Bell Labs — on WebAssembly with plugin extensibility. No native binaries — every component compiles to .wasm modules that run in browsers, on servers, and at the edge with identical output everywhere.
wawk consists of wawk-core as the shared engine, wawk-wasi as a pure WASI command-line module, and wawk-bindgen as a JavaScript-importable library. All three share the same engine code and produce identical output for the same input. Extensions are built as WIT Component Model plugins — standalone .wasm modules loaded via the --plugin flag.
Runtime
Browser, Server, Edge
Language
100% Rust → Wasm
Setup
Quick Start
Prerequisites
$ curl https://wasmtime.dev/install.sh -sSf | bash
$ cargo install wasm-pack
Build all Wasm targets
$ make build-wasm
Run wawk-wasi
$ cargo build -p wawk-wasi --target wasm32-wasip1 --release
$ printf '{ sum += $1 } END { print sum }\n1\n2\n3\n' \
| wasmtime target/wasm32-wasip1/release/wawk-wasi.wasm
6
$ printf '/error/ { print $0 }\ninfo: ok\nerror: disk full\n' \
| wasmtime target/wasm32-wasip1/release/wawk-wasi.wasm
error: disk full
Use wawk-bindgen in Node.js
$ wasm-pack build crates/wawk-bindgen \
--target nodejs \
--out-dir ../../pkg-node \
--release
$ node crates/wawk-bindgen/tests/node_e2e.js
Use wawk-bindgen in the browser
$ wasm-pack build crates/wawk-bindgen \
--target web \
--out-dir ../../pkg-web \
--release
Background
AWK History
AWK is a text-processing language created at Bell Labs. It reads input line by line, matches patterns, and executes actions. It is part of the POSIX standard and has been shipped with every Unix system since the late 1970s.
1977
AWK is created
Alfred Aho, Peter Weinberger, and Brian Kernighan develop AWK at Bell Labs. The name comes from their initials.
1988
The AWK Programming Language published
The authors publish a book covering the language in depth, including associative arrays and regular expressions.
1990s
POSIX standardization
AWK is included in the POSIX standard. Multiple implementations exist: gawk, mawk, nawk, and the original awk.
2026
AWK reinvented in Rust and Wasm
AWK reimplemented in Rust, compiled to Wasm. Runs in browsers and edge runtimes with no OS dependencies.
What AWK is used for
AWK is a general-purpose text processing tool. Common uses include:
Log analysis
Filter, count, and aggregate entries from server logs and structured text streams.
CSV / TSV processing
Extract columns, reshape rows, convert between delimited formats.
Text transformation
Regex-driven rewriting, format conversion, structured extraction from unstructured text.
Reporting
One-pass counting, summing, grouping, and summary generation.
Extensions
AWK → Wawk
AWK has done its job remarkably well for nearly five decades. Wawk builds on that foundation, adding capabilities that the WebAssembly platform makes possible — without changing the AWK language itself.
| Scenario |
AWK (system-installed) |
Wawk (Wasm) |
| Run in browser |
Outside the browser's scope |
Native Wasm execution |
| Deploy to edge |
Designed for server-based pipelines |
Edge runtimes, serverless |
| Custom functions |
C extensions (gawk) |
Wasm extensions (Rust, C, Go, TS) |
| Sandboxing |
OS-level isolation |
Wasm runtime sandbox |
| Distribution |
Pre-installed on Unix systems |
Single .wasm file |
| Cross-platform consistency |
Multiple implementations (gawk, mawk, nawk) |
Identical output everywhere |