0% found this document useful (0 votes)
28 views

Programming Languages

A programming language is a notation for writing computer programs to specify computations or algorithms. Programming languages allow humans to communicate instructions to machines and usually contain abstractions for defining and manipulating data structures or controlling program flow. The syntax of a programming language describes the valid combinations of symbols that form a syntactically correct program, and is often defined using regular expressions and Backus-Naur Form.

Uploaded by

Nafees Bhatti
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Programming Languages

A programming language is a notation for writing computer programs to specify computations or algorithms. Programming languages allow humans to communicate instructions to machines and usually contain abstractions for defining and manipulating data structures or controlling program flow. The syntax of a programming language describes the valid combinations of symbols that form a syntactically correct program, and is often defined using regular expressions and Backus-Naur Form.

Uploaded by

Nafees Bhatti
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming languages

A programming language is a notation for writing programs, which are specifications of a computation or algorithm.
[1]
Some, but not all, authors restrict the term "programming language" to those languages that can express all possible
algorithms.

 Function and target: A computer programming language is a language[3] used to write computer programs,

which involve a computer performing some kind of computation[4] oralgorithm and possibly control external devices

such as printers, disk drives, robots,[5] and so on. For example PostScript programs are frequently created by

another program to control a computer printer or display. More generally, a programming language may describe

computation on some, possibly abstract, machine. It is generally accepted that a complete specification for a

programming language includes a description, possibly idealized, of a machine or processor for that language.[6] In

most practical contexts, a programming language involves a computer; consequently programming languages are

usually defined and studied this way.[7] Programming languages differ from natural languagesin that natural

languages are only used for interaction between people, while programming languages also allow humans to

communicate instructions to machines.

 Abstractions: Programming languages usually contain abstractions for defining and manipulating data

structures or controlling the flow of execution. The practical necessity that a programming language support

adequate abstractions is expressed by the abstraction principle;[8] this principle is sometimes formulated as

recommendation to the programmer to make proper use of such abstractions.[9]

 Expressive power: The theory of computation classifies languages by the computations they are capable of

expressing. All Turing complete languages can implement the same set ofalgorithms. ANSI/ISO SQL and Charity are

examples of languages that are not Turing complete, yet often called programming languages.[10][11]

Markup languages like XML, HTML or troff, which define structured data, are not generally considered programming

languages.[12][13][14] Programming languages may, however, share the syntax with markup languages if a computational

semantics is defined. XSLT, for example, is a Turing complete XML dialect.[15][16][17] Moreover, LaTeX, which is mostly used

for structuring documents, also contains a Turing complete subset.

Syntax:
A programming language's surface form is known as its syntax. Most programming languages are purely textual; they use

sequences of text including words, numbers, and punctuation, much like written natural languages. On the other hand,

there are some programming languages which are more graphical in nature, using visual relationships between symbols

to specify a program.
The syntax of a language describes the possible combinations of symbols that form a syntactically correct program. The

meaning given to a combination of symbols is handled by semantics (either formal or hard-coded in a reference

implementation). Since most languages are textual, this article discusses textual syntax.

Programming language syntax is usually defined using a combination of regular expressions (for lexical structure)

and Backus–Naur Form (for grammatical structure). Below is a simple grammar, based on Lisp:

expression ::= atom | list


atom ::= number | symbol
number ::= [+-]?['0'-'9']+
symbol ::= ['A'-'Z''a'-'z'].*
list ::= '(' expression* ')'

You might also like