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
OS Dependencies
None
License
MIT / Apache 2.0
Language Specification Open Playground View on GitHub

Quick Start

Prerequisites

# Install Wasmtime (for wawk-wasi) $ curl https://wasmtime.dev/install.sh -sSf | bash # Install wasm-pack (for wawk-bindgen) $ cargo install wasm-pack

Build all Wasm targets

$ make build-wasm

Run wawk-wasi

# Build $ cargo build -p wawk-wasi --target wasm32-wasip1 --release # Sum a column $ printf '{ sum += $1 } END { print sum }\n1\n2\n3\n' \ | wasmtime target/wasm32-wasip1/release/wawk-wasi.wasm 6 # Filter lines matching a pattern $ 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

# Build for Node.js $ wasm-pack build crates/wawk-bindgen \ --target nodejs \ --out-dir ../../pkg-node \ --release # Run the end-to-end test $ node crates/wawk-bindgen/tests/node_e2e.js

Use wawk-bindgen in the browser

# Build for the browser $ wasm-pack build crates/wawk-bindgen \ --target web \ --out-dir ../../pkg-web \ --release # Open pkg-web/test.html in a browser

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.

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

Learn More

Language Specification & Tutorial
Complete AWK and Wawk reference with 13 runnable examples. POSIX fundamentals plus Wawk extensions: PropertyTree-native access, dot-notation, and plugins.
Plugin Development
Build Wawk plugins in Rust, C, Go, or TypeScript using the WIT Component Model. Step-by-step guide with wawk-hello example.
Playground
Full-screen Wawk playground. Write AWK scripts and run them as real WebAssembly in your browser. Includes JSON and plugin examples.