FA23 G3 Presentation - Chapter9

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

CSI104

CHAPTER 9:
PROGRAMMING
LANGUAGES
Presentation: Group 3
Lecturer: NhonNT
SUMMARY
I. EVOLUTIONS
- Machine languages
- Assembly languages
- High-level languages
II. TRANSLATION
- Translations process
- Compilation and Interpretation
III.PROGRAMMING PARADIGMS
- Procedural paradigms
- Object-oriented paradigm
- Functional paradigm
- Declarative paradigm
IV. CONCLUSION
1
I. EVOLUTIONS
Programming needs a
computer language—a set of
predefined words arranged
into a program with syntax
rules. - Machine languages.
- Assembly languages.
- High-level languages.
2
MACHINE LANGUAGES
- In the early days, only machine
languages existed.
- Machine language is composed of 0s
and 1s, specific to each computer.
- Tedious and machine-dependent;
considered the first generation of
programming languages.
3
ASSEMBLY LANGUAGES
- Introduced to replace machine
code with symbols or
mnemonics.
- Assembly languages used
symbolic representation for
instructions.
- Assembler translates assembly
code to machine code.
4
HIGH-LEVEL LANGUAGES
- Developed to improve programming
efficiency and portability.
- Portable across different computers,
relieving programmers from hardware
details.
- Examples: BASIC, COBOL, Pascal, Ada, C,
C++, Java.

5
II. TRANSLATION
• Modern programs use high-level languages and
need translation into the machine language of a
specific computer for execution.
• The original high-level code is called the source
program, and its translated form is the object
program.
• Compilation and interpretation are the two
6
common methods of translation.
TRANSLATION PROCESS

• Programs are written in high-level languages.


• Translation into machine language using compilation or interpretation.
• Compilation translates the entire source program at once.
• Translation process step:
- Lexical analyzer, syntax analyzer, semantic analyzer, and code generator. 7
- Source program translated into object program.
COMPILATION and INTERPRETATION
- Compilation translates high-level - Interpretation translates source code
programming language into machine code or line by line.
intermediate code using a specialized program
called a compiler.
- Two approaches to interpretation:
first approach (BASIC, APL) and second
- A compiler translates the entire source
program into the object program. approach (Java).
- It performs several tasks, including lexical
analysis, syntax analysis, semantic analysis,
optimization, and code generation.
8
III. PROGRAMMING PARADIGMS
- Four paradigms: procedural, object-
oriented, functional, declarative.
- Procedural paradigm: active agent
manipulates passive objects.

9
PROCEDURAL PARADIGMS
Procedural Paradigm Essentials:
•Distinct entities: procedures and objects.
•Programs triggering procedures to act on objects.
•Emphasis on separating procedures from program
triggers.
Procedural Program Components:
•Object creation (declaration).
•Sets of procedure calls (commands).
•Sets of codes for each procedure.
Key Procedural Languages: FORTRAN (FORmula
TRANslation); COBOL (COmmon Business-Oriented
Language); Pascal; C; Ada
10
OBJECT-ORIENTED PARADIGM
- Active objects with methods to perform
actions.
- Objects of the same type share
methods.
- Inheritance and polymorphism are key
concepts.

11
FUNCTIONAL PARADIDM
- Programs considered mathematical
functions.
- Predefined primitive functions
combined to create new functions.
- Encourages modular programming.

12
DECLARATIVE PARADIGM

- Based on logical reasoning and deduction.


- Limited to specific domains such as artificial intelligence.
- Example: Prolog.

13
IV. CONCLUSION

- Programming languages have evolved to meet diverse needs.


- Each paradigm offers unique approaches to problem-solving.
- Choosing the right paradigm depends on the nature of the problem.

14

You might also like