2. Outlin
e
►Definition of programming language
►Role of programming languages
►Why study programming languages
►Influences on language design
►Attributes of good programming language
2
3. 3
What is a programming language?
Programming Language – Definition:
A programming language is a set of rules that
provides a way of telling a computer what
operations to perform.
A language that is intended for the expression of computer programs and that is
capable of expressing any computer program.
A vocabulary and set of grammatical rules for instructing a computer to perform
specific tasks
4. Programming Languages
4
Programming languages allow programmers to code software.
The three major families of languages are:
Machine languages
Assembly languages
High-Level languages
5. Machine Languages
5
The “native” language of a computer.
Comprised of 1s and 0s
Difficult to program – one misplaced 1 or 0 will cause the program to fail.
111010101110
10100011110111
Example of code:
1110100010101
10111010110100
6. Assembly Languages
6
Assembly languages are a step towards easier programming.
Assembly languages are comprised of a set of elemental commands which are tied
to a specific processor.
Assembly language code needs to be translated to machine language before the
computer processes it.
Example:
ADD R1,R2 ;1001011011010011
7. High-Level Languages
7
High-level languages represent a giant leap towards easier programming.
The syntax of HL languages is similar to English.
High level language includes pascal, C, C++, FORTRAN, Java, Visual
Basic, and many more.
One command in high-level language may translate to tens of machine
language instructions.
8. Compiling
8
Regardless of the HL language , all HL programs need to be translated to
machine code so that the computer can process the program .
Some programs are translated using a compiler.
When programs are compiled, they are translated all at once.
Compiled programs typically execute more quickly than interpreted
programs, but have a slower translation speed.
10. Interpreting
10
Some programs are translated using an interpreter. Such programs are translated
line-by-line instead of all at once (like compiled programs).
Interpreted programs generally translate quicker than compiled programs, but
have a slower execution speed.
Both interpreters and compilers are available for most high-level languages.
However, BASIC and LISP were especially designed to be executed by an
interpreter
12. 14
Hybrid Implementation Systems
Some language implementation systems are a compromise between compilers and
pure interpreters; They translate high-level language programs to an intermediate
language designed to allow easy interpretation.
This method is faster than pure interpretation because the source language
statements are decoded only once.
15. Role of Programming Languages
Computers have been applied to different areas, from controlling nuclear
power plants to providing video games in mobile phones.
Because of this great diversity in computer use, programming languages with
very different goals have been developed.
Scientific applications
• They have relatively simple data structures but require large numbers of
floating-point arithmetic computations.
• The most common data structures are arrays and matrices.
15
16. Role of Programming Languages
Scientific applications…
• The first language for scientific applications was FORTRAN. ALGOL 60 and
most of its descendants were also intended for use in this area
BusinessApplications
The first successful high-level language for business was COBOL.
Business languages are characterized by facilities for producing elaborate
reports, precise ways of describing and storing decimal numbers and character
data, and the ability to specify decimal arithmetic operations.
16
17. 20
Role of Programming Languages…
Artificial Intelligence
It is a broad area of computer applications characterized by the use of symbolic
rather than numeric computations.
Symbolic computation means symbols, consisting of names rather than
numbers, are manipulated.
Symbolic computation is more conveniently done with linked lists of data
rather than arrays.
for AI applications
The first widely used programming language developed
was the functional language LISP.
PROLOG is also used in this area.
Some AI applications have been written in systems languages such as C.
18. 21
Role of Programming Languages…
Systems Programming
The operating system and all of the programming support tools of a computer system are
collectively known as its systems software.
Systems software is used almost continuously and so it must be efficient.
The UNIX operating system is written almost entirely in C which has made it relatively easy
to port, or move, to different machines.
Web Software:
The World Wide Web is supported by an eclectic collection of languages, ranging from
markup languages, such as XHTML, which is not a programming language, to general-
purpose programming languages, such as Java.
19. Why study programming languages?
19
To improve your ability to develop effective algorithms and to improve your use
of existing programming language.
To increase your vocabulary of useful programming constructs.
To allow a better choice of programming languages.
To make it easier to learn a new language.
To make it easier to design a new language.