Monday, May 16, 2016

Computer Languages

Computer Languages are designed to communicate with a machine(Computer) through the set of instructions. 
In general Computer Languages include

  1. Command Language(through which users communicate with the operating system)
  2. Construction Language(a general category that includes configuration languages, toolkit languages, and programming languages)
  3. Configuration Language(a language used to write configuration files)
  4. Data Serialization(is just a format)
  5. Markup Language(a grammar for annotating a document in a way that is syntactically distinguishable from the text)
  6. Machine Language(a set of instructions executed directly by a computer's central processing unit)
  7. Modeling Language(a formal language used to express information or knowledge, often for use in computer system design)
  8. Style Sheet Language(is a computer language that expresses the presentation of structured documents)
  9. 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;
  • number is an unbroken sequence of one or more decimal digits, optionally preceded by a plus or minus sign;
  • symbol is a letter followed by zero or more of any characters (excluding whitespace); and
  • list is a matched pair of parentheses, with zero or more expressions inside it.
Not all syntactically correct programs are semantically correct. and may results in an error on translation or execution. Even when a program is well-defined within a language, it may still have a meaning that is not intended by the person who wrote 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.
There are many approaches to formal semantics; these belong to three major classes:

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 programsAxiomatic 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. 

Computer Languages are also known as Programming Languages.


No comments:

Post a Comment