Programming Languages
1. High-Level Languages (HLL)
High-level languages are designed to be human-oriented. They use English-like keywords (e.g., print, if, while) and mathematical notation.
- Portability: Can be run on different types of CPU architectures without rewriting the code.
- Ease of Use: Easier to read, write, and maintain. One line of HLL code usually represents many lines of machine code.
- Examples: Python, Java, C++, PHP, Visual Basic.
2. Low-Level Languages (LLL)
Low-level languages are machine-oriented. They are closely linked to the specific architecture of the CPU.
A. Machine Code
The only language the CPU actually understands. It consists of binary digits ($0$s and $1$s).
01101010 00001111 10101010No translation is needed for machine code.
B. Assembly Language
Uses Mnemonics (short codes like ADD, SUB, LDA) to represent machine code instructions. There are numerous assembly languages, as each one is unique to a specific processor type.
3. Comparison: Compiled vs. Interpreted Languages
High-level languages are categorized by how they are transformed into executable code. Here are the advantages and disadvantages of each approach:
| Feature | Compiled Languages | Interpreted Languages |
|---|---|---|
| Operation | Translates the entire source code into an object file (machine code) in one go. | Translates and executes the code line-by-line as the program runs. |
| Execution Speed | Very Fast. The translation is already done; the CPU just runs the binary file. | Slower. The computer has to translate every line every time the program is run. |
| Debugging | Harder. Errors are reported at the end of the compilation, making them harder to trace. | Easier. The program stops exactly at the line where the error occurs. |
| Distribution | Secure. You only give the user the executable file; they cannot see your original code. | Less Secure. You must share the original source code with the user for them to run it. |
| Memory Usage | Requires more memory initially for the compiler and the object file. | Requires the interpreter to be present in memory during every execution. |
⚠️ Exam Summary:
- Use High-Level for general software development and portability.
- Use Low-Level for high performance or controlling specific hardware (RAM/Registers).
- Use Compiled for final, high-speed software releases.
- Use Interpreted for testing and learning (Educational purposes).
End of Programming Language Notes • Ready to move to Translators?