Q1) What is Programming Language?
Solution: A programming language is a computer language used by programmers to create software programs, scripts, or other instructions that computers can execute.
Q2) Explain different types of programming languages.
Solution: Programming languages can be classified into two different types:
1. Low-Level Programming Language
A low-level programming language is one that offers little or no abstraction of programming concepts and is very close to writing actual machine instructions. It can be further classified into the machine-level language and assembly language.
a) Machine-Level language
It is the most fundamental of all programming languages. It is represented on binary digits, which are 1s and 0s so that computers can understand it directly. As the machine reads machine-level language, it does not require any translators such as a compiler or interpreter. It executes faster and has a higher machine efficiency. Even a simple program, however, takes a long time to write. As a result, debugging is difficult. It is more prone to errors, and user efficiency is low.
b) Assembly language
Mnemonics are English-like abbreviations used in assembly language. They are less difficult to program than machine language because they use short words to represent common operations such as SUM, DIVIDE, PRODUCT, and so on. Because they are not directly understood by computers, a translator known as an Assembler is used to convert assembly language into machine code.
Assembly language is machine-dependent, which means that different assembly languages are created for different types of CPUs.
2) High-Level Language
A high-level language is any programming language that allows program development in a much more user-friendly programming context and is generally independent of the hardware architecture of the computer. A high-level language is more abstract from the computer and focuses on programming logic rather than underlying hardware components such as memory addressing and register utilization.
They are easy to use and understand as their syntax is based on human language. Instead of binary digits, they use familiar English words. High-level programming languages are simple to read, write, and understand.
To convert high-level language into machine language, translators such as Compilers or Interpreters should be used. When compared to low-level languages, programs written in high-level languages run slower. Machine efficiency is low, whereas user efficiency is high.
Q3) Why is High-Level Language(HLL) preferred to Low-Level Language(LLL)?
Solution: High-level language is much closer to human language whereas low-level language is expressed in terms of machine expressions and operations. A high-level language is user-friendly, and easier to code and debug than a low-level language. They are less error-prone than machine-level language. That's why high-level language is much preferred over low-level language.
Q4) Differentiate High-Level Language and Low-Level Language?
Solution: High-level language and low-level language are differentiated in the following tables:
High-Level Programming Language | Low-Level Programming Language |
---|---|
It is a user-friendly programming language. | It is machine friendly programming language. |
They use translators like compilers or interpreter to convert it into machine language. |
An assembler is required for low-level language to directly translate machine language instructions. |
High user efficiency | Low user efficiency |
Low machine efficiency | High machine efficiency |
Easy to debug | Hard to trace errors and debug |
Widely used by programmers | They are not common nowadays. |
Allow higher abstractions | It allows very low abstraction or no abstraction at all. |
Portable to use on different devices | Less portable |
Example: C, PYTHON | Example: Machine code and assembly language |
Compiler | Interpreter |
---|---|
Translate the entire source code into object code at once | Translates one program instruction at a time |
It is faster than the interpreter | It is slower than the compiler. |
Debugging is hard compared to interpreting. | Debugging is easier compared to compilers. |
The compiler is a complex program and larger than the interpreter. | The interpreter is simple to program and smaller than the compiler. |
It occupies more memory. | It occupies less memory. |
The program need not be retranslated for execution next time | The program needs to be translated every time on execution. |
Example: C, C++, FORTRAN | Example: Python, QBASIC |
If you have any questions on this topic to be added, please contact us. Thank you!