re: Awk - A useful little language VIEW POST

FULL DISCUSSION
 

Interesting! Just wondering why a whole new language for a feature? (Not to sound critical).

Are there any specialised optimizations specific to file i/o and parsing the file at lower level ? If so, it would be great to have it also as wrapper for other langaugaes. Any benchmarking ?

🙂🙂

 

Hi Ishani,

awk is a very old language (1977), predating scripting languages like perl and python. As part of Unix philosophy, it is used in combination with other Unix tools. It is simpler and faster to write than say a python script. Most awk uses are simple one-liners to extract particular columns.

It is indeed very fast as all it does is: For each line:

  • Check if line matches a pattern
  • Perform the associated action on the pattern

There was this famous article which showed that clever use of command-line tools can be several times faster than some big-data tools.

code of conduct - report abuse