3 ms·
I came to AWK via DTrace http://dtrace.org/blogs/about/ http://dtrace.org/blogs/about/ When processing event streams, it's very natural to express transformati
by heinrichhartman 6y ago
I came to AWK via DTrace http://dtrace.org/blogs/about/ http://dtrace.org/blogs/about/
When processing event streams, it's very natural to express transformation as FILTER + ACTION rules.
AWK is an embodiment of this idea for the domain of text processing where events are lines (or multi-line records).
DTrace uses the paradigm to process low-level system events (like scheduling events, or (kernel) function calls).
It's a good paradigm, worth using.
However, it's easily replicated in every other language with a loop:
while true {
rec = read()
if( filter1(rec) ) { action1(rec) }
if( filter2(rec) ) { action2(rec) }
...
}
You don't need a special language to do event processing like this.