Mawk

From Rosetta Code
Mawk is an implementation of AWK. Other implementations of AWK.

mawk is Mike Brennan's awk. It is compatible with nawk and POSIX awk. It has at least one more feature: RS can be a regular expression.

mawk's interpreter tries to be fast. It translates each program to an internal bytecode. This program, to sum the numbers on each input line, becomes ten instructions of bytecode:

$ mawk -W dump '{ sum += $0 } END { print sum }' 
END
000 pushi       sum
002 pushint     1
004 print
006 exit0
MAIN
000 omain
001 pusha       sum
003 pushi       $0
005 add_asg
006 pop
007 ol_gl

The last version from Mike Brennan was mawk 1.3.3. Thomas E Dickey revived the project and made mawk 1.3.4.