Topic 1: Introduction: Overview of Programming Languages
Topic 1: Introduction: Overview of Programming Languages
Topic 1: Introduction: Overview of Programming Languages
Programming Language
Programming Languages are notations for describing computations to people and to machines. All the
software running on all computers was written in some programming languages.
Programming language abstractions fall into two general categories: data abstraction and control
abstraction. Data abstractions simplify for human users the behavior and attributes of data, such as
numbers, character strings, and search trees. Control abstractions simplify properties of the transfer of
control, that is, the modification of the execution path of a program based on the situation at hand.
Examples of control abstractions are loops, conditional statements, and procedure calls.
Computational Paradigms
There are 4 main programming paradigms:
Imperative Paradigm
First do this and next do that
This short phrase describes the imperative paradigm, where the basic idea is the command, which has a
measurable effect on the program state. The order of the commands is also important. Sometimes is
also referred as the procedural programming or structured programming. Data and operations on the
data are separated; you have to send data to procedures and functions.
Functional Paradigm
Evaluate an expression and use the resulting value for something
Logical Paradigm
Answer a question via search for a solution
Logical paradigm is based on axioms, inference rules and queries. The logical paradigm fits extremely
well when applied in problem domains that deal with the extraction of knowledge from basic facts and
relations.
Object-Oriented Paradigm
Send messages between objects to simulate the temporal evolution of a set of real world phenomena
The object oriented paradigm has gained great popularity. Combines the power of procedural languages
with an added dimension that provides more flexibility, modularity, clarity, and reusability through class
encapsulation, class inheritance and dynamic binding. Data and operations are placed within a single
entity called an object.
Language Definition
Language definition can be loosely divided into two parts: syntax, or structure, and semantics, or
meaning. Syntax and semantics are closely related. Semantic should follow directly from syntax (what
the statement is meant to accomplish).
Language Syntax
The formal rule of how expressions are written or arranged in a programming language is called the
syntax of that language.
Language Semantics
Its semantics is the meaning of those expression, statements, and program units
Language Translation
For a programming language to be useful, it must have a translatorthat is, a program that accepts
other programs written in the language in question and that either executes them directly or transforms
them into a form suitable for execution.
A translator that produces an equivalent program in a form suitable for execution is called a compiler.
Language Design
A successful programming language should facilitate:
1. Efficiency Abstractions
2. Simplicity Complexity Control
3. Expressiveness Readability
Readability
It is a challenge of programming language design to achieve the power, expressiveness &
comprehensibility that human readability requires while at the same time retaining the precision &
simplicity that is needed for machine translation
Abstractions
A successful programming language has facilities for the: