Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is awk a programming language or just a tool? [closed]

Tags:

shell

awk

I have often seen people referencing "awk" as a programming language.According to my intuition all I understand about awk is that it is a tool used for some specific tasks.

So why would some people call it as a programming language?

like image 924
DesirePRG Avatar asked Dec 07 '22 07:12

DesirePRG


2 Answers

awk is a programming language and it's designed for specific kind of tasks, these two things are not mutually exclusive. Much like php and javascript are also programming languages.

A tool lets you perform a single task or set of closely related tasks whereas with a programming language you can create any tool that is computationally possible.

Awk is a Turing Complete language, compare it with the tool grep, you have variables, conditionals (if,else,...) ,repetition (for,while,..), functions, ect. you can create an awk script to do whatever you may require but with grep you can only ever extract text from a file. Awk is designed for text-based processing and still remains one of the best programming languages for this however you could write a compiler, interpreter, webserver, or anything else you wanted in awk - but that doesn't mean you should.

like image 130
Chris Seymour Avatar answered Mar 06 '23 12:03

Chris Seymour


Even though AWK is used in very restricted areas, it is Turing Complete and hence passes the test to qualify as a programming language.

Wikipedia defines AWK as follows. The AWK utility is an interpreted programming language typically used as a data extraction and reporting tool. But still it depends on individual users whether to call AWK simply a utility program or a programming language. But if you believe AWK is just a tool, then serious questions can be asked about the status of many so called languages like HTML, XML, etc. Also remember that the language Perl was heavily influenced by AWK.

like image 22
Deepu Avatar answered Mar 06 '23 11:03

Deepu