Programming Language
TOPIC: Programming Languages
Class: SSS One
Definition of Terms
Program: A computer program is a sequence of related instructions (commands) that tell the computer how to accomplish a specific task. A program can also be defined as a set of instructions that are executed by the CPU.
Programming: Programming is the act of writing computer programs. These are typically written by trained and qualified people called programmers.
Computer Language: Any language used by, or associated with, a computer system.
Programming Language: An artificial language that can be used to control the behavior of a machine, particularly a computer. A programming language is the primary means through which a programmer communicates with the computer to solve different categories of problems.
Syntax: The set of rules governing how the words, symbols, and expressions in the language must be written to form valid statements.
Semantics: The meaning associated with each valid statement (or word) used in a particular language.
NOTE: Markup languages like HTML are generally not regarded as programming languages because they communicate the formatting or structure of a document, rather than controlling a machine's behavior through execution logic.
Levels of Programming Language
Programming languages are typically categorized into three main levels based on their degree of abstraction from the computer's hardware:
1. Machine Language (First Generation - 1GL)
2. Low-Level / Assembly Language (Second Generation - 2GL)
3. High-Level Language (Third, Fourth, & Fifth Generations - 3GL+)
Machine Language (First Generation - 1GL)
This is the most basic level, consisting solely of instructions written in binary code (0s and 1s). It is the only language the CPU can execute directly without translation.
Advantages of Machine Language
- Extremely fast execution speed because no translation is needed.
- Most efficient use of primary memory and system resources.
- Provides detailed control over the computer's hardware.
- Essential for developing performance-critical sections of operating systems.
Disadvantages of Machine Language
- Extremely difficult for humans to read, write, and understand.
- Highly error-prone; debugging is tedious and complex.
- Machine-dependent (specific to one CPU architecture).
- Requires deep knowledge of the computer's internal architecture.
Low-Level / Assembly Language (Second Generation - 2GL)
Assembly language is one level above machine language. It replaces binary digits with mnemonic codes (short abbreviations like ADD, SUB, JMP) and symbolic addresses. A program called an Assembler translates it into machine code.
Advantages of Low-Level Languages
- Easier to understand and use compared to pure machine code.
- Allows fine-grained control over hardware and memory.
- Produces highly optimized code.
- Useful for embedded systems and device drivers.
Disadvantages of Low-Level Languages
- Still machine-dependent and not portable.
- Requires knowledge of processor instruction sets.
- Time-consuming for large applications.
- Requires translation by an assembler.
High-Level Language (Third, Fourth, & Fifth Generations - 3GL+)
These languages are programmer-friendly, using statements that resemble natural human language and mathematical notation. They abstract away hardware complexities.
Examples: PASCAL, BASIC, C++, Java, FORTRAN, COBOL, Python.
Advantages of High-Level Languages
- Easy to learn, read, and maintain.
- Portable across multiple systems.
- Less error-prone and easier to debug.
- Faster program development.
- No deep hardware knowledge required.
Disadvantages of High-Level Languages
- Slower execution compared to low-level code.
- Less direct control over hardware.
- Less memory-efficient.
- Requires compilers or interpreters.
Comparison of Language Levels
| Language | Key Characteristics |
|---|---|
| Machine Language | 1. Machine-dependent. 2. Uses only binary code. 3. No translator required; executed directly by the CPU. |
| Low-Level (Assembly) | 1. Machine-dependent. 2. Uses mnemonics and symbols. 3. One Assembly instruction translates to one Machine instruction. 4. Requires an Assembler. |
| High-Level Language | 1. Machine-independent. 2. Uses English-like syntax. 3. One instruction translates to many machine instructions. 4. Requires a Compiler or Interpreter. |
Comments
Post a Comment