Computer Languages are designed to communicate with a machine(Computer) through the set of instructions.
In general Computer Languages include
- Command Language(through which users communicate with the operating system)
- Construction Language(a general category that includes configuration languages, toolkit languages, and programming languages)
- Configuration Language(a language used to write configuration files)
- Data Serialization(is just a format)
- Markup Language(a grammar for annotating a document in a way that is syntactically distinguishable from the text)
- Machine Language(a set of instructions executed directly by a computer's central processing unit)
- Modeling Language(a formal language used to express information or knowledge, often for use in computer system design)
- Style Sheet Language(is a computer language that expresses the presentation of structured documents)
- Query Language(used to make queries in databases and information systems)
The description of a programming language is usually split into the two components of syntax (form) and semantics(meaning).
Syntax
Programming language syntax is usually defined using a combination of regular expressions (for lexical structure) and Backus– Naur Form (for grammatical structure).
The grammar specifies the following:
- an expression is either an atom or a list;
- an atom is either a number or a symbol;
- a number is an unbroken sequence of one or more decimal digits, optionally preceded by a plus or minus sign;
- a symbol is a letter followed by zero or more of any characters (excluding whitespace); and
- a list is a matched pair of parentheses, with zero or more expressions inside it.
Semantics
The term Semantics refers to the meaning of languages, as opposed to their form (syntax).
The field of formal semantics encompasses all of the following:
- The definition of semantic models
- The relations between different semantic models
- The relations between different approaches to meaning
- The relation between computation and the underlying mathematical structures from fields such as logic, set theory, model theory, category theory, etc.
Denotational semantics(mathematical semantics or Scott–Strachey semantics)
Denotational semantics is concerned with finding mathematical objects(Denotations) called domains that represent what programs do.
Operational semantics
The operational semantics for a programming language describes how a valid program is interpreted as sequences of computational steps. These sequences then are the meaning of the program. In the context of functional programs, the final step in a terminating sequence returns the value of the program.Axiomatic semantics
Axiomatic semantics is an approach based on mathematical logic to proving the correctness of computer programs. Axiomatic semantics define the meaning of a command in a program by describing its effect on assertions about the program state. The assertions are logical statements - predicates with variables, where the variables define the state of the program.
No comments:
Post a Comment