Translated from the article “低 水準 言語 と 高 水準 言語 と は? 5 分 で わ か り や す く 解説!”
Depending on the characteristics, programming languages can be divided into high-level programming languages and low-level programming languages.
So, what is the high / low standard for programming languages, and what are the advantages of each language?
In the following article, I will explain in an easy way to understand the 2 issues mentioned above.
1.Standard programming language
The standard classification of real programming languages is very simple.
A language close to the computer language is considered a high-level programming language; conversely, languages close to the natural language of humans will be called higher-level programming languages.
The closer the language is to the human language, the higher its level?
Low-level programming language, English is low-level programming language. The lower order here refers to the language being of a lower level, in other words, the language of recording and giving more detailed and specific instructions for computer operations.
On the other hand, high-level languages, or high-level programming languages, are languages that belong to a higher level, more detailed and specific instructions that will be handled by the compiler.
So the standard here is the dimension of processing?
The word dimension that I use in the explanation above can be a little confusing. The dimension here is a little different from the Dimention of 2D, 3D that you are still familiar with in math. Dimension refers to the level at which an object is viewed.
Consider, for example, the tier tier of a potato chip, for example.
Examining it from the molecular and atomic perspective will be considered to be observed at the lower level.
So, the same is true for the computer tier.
2.Low-level programming language (low-level programming language)
Among programming languages, Assembly language is called a prime example for low-level programming languages. It is the common name for languages other than machine language, but very close to machine language.
Assembly language is a version that is easier to understand for humans than the language of computers is only composed of two states with electricity (1) and no electricity (0).
Characteristics and advantages of low-level programming languages
Low-level languages such as Machine language and assembly language have the following characteristics and advantages:
- Easy to understand computer: The computer can immediately understand and execute instructions written in machine language. In contrast, for humans, it’s hard to imagine what’s going on
- Can write the specific processing for each platform
- It is possible to perform operations at the CPU level such as manipulating memory, controlling IO
An example of a program written in assembly language
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
XOR r0, r0, r0 ADDI r8, r0, 0 ADDI r10, r0, 512 ADDI r14, r0, 1 ADDI r8, r0, 0 ADDI r24, r0, 400 FOR0S: BLE r24, r8, FOR0E ADD r15, r8, r10 SW r14, 0(r15) ADDI r8, r8, 4 J FOR0S FOR0E: SW r0, 0(r10) SW r0, 4(r10) ADDI r9, r0, 2 ADDI r25, r0, 51 FOR1S: BLE r25, r9, FOR1E SLL r14, r9, 2 ADD r15, r10, r14 LW r11, 0(r15) BNE r0, r11, IF0E ADDI r9, r9, 1 J FOR1S IF0E: SLL r14, r9, 3 ADD r8, r0, r14 ADDI r24, r0, 400 FOR2S: BLE r24, r8, FOR2E ADD r15, r8, r10 SW r0, 0(r15) SLL r14, r9, 2 ADD r8, r8, r14 J FOR2S FOR2E: ADDI r9, r9, 1 J FOR1S FOR1E: ADDI r8, r0, 8 ADDI r24, r0, 400 FOR3S: BLE r24, r8, FOR3E ADD r15, r8, r10 LW r11, 0(r15) BEQ r0, r11, IF1E SRA r14, r8, 2 ADD r15, r8, r10 SW r14, 0(r15) IF1E: ADDI r8, r8, 4 J FOR3S FOR3E: HALT |
An example of a program written in machine language:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
00000000000000000000000000001010 00000100000010000000000000000000 00000100000010100000001000000000 00000100000011100000000000000001 00000100000010000000000000000000 00000100000110000000000110010000 10001111000010000000000000010000 00000001000010100111100000000000 01100001111011100000000000000000 00000101000010000000000000000100 10100000000000000000000000011000 01100001010000000000000000000000 01100001010000000000000000000100 00000100000010010000000000000010 00000100000110010000000000110011 10001111001010010000000001000100 00000001001000000111000010010000 00000001010011100111100000000000 01000001111010110000000000000000 10000100000010110000000000001000 00000101001010010000000000000001 10100000000000000000000000111100 00000001001000000111000011010000 00000000000011100100000000000000 00000100000110000000000110010000 10001111000010000000000000010100 00000001000010100111100000000000 01100001111000000000000000000000 00000001001000000111000010010000 00000001000011100100000000000000 10100000000000000000000001100100 00000101001010010000000000000001 10100000000000000000000000111100 00000100000010000000000000001000 00000100000110000000000110010000 10001111000010000000000000100000 00000001000010100111100000000000 01000001111010110000000000000000 10000000000010110000000000001100 00000001000000000111000010010010 00000001000010100111100000000000 01100001111011100000000000000000 00000101000010000000000000000100 10100000000000000000000010001100 11111100000000000000000000000000 |
Do you find it difficult to understand? This is the world of low-level programming languages
3. High-level programming language programming high-level programming language)
In contrast to low-level programming languages, high-level programming languages. Currently, most programming languages are classified in this group.
Compared to other programming languages, the C language level is lower, however, it is still classified as a high-level programming language.
Features and advantages of high-level programming languages:
- Easy to understand for humans: Due to being written closer to the natural language of humans, for us, of course, higher-level programming languages will be easier to understand. In fact, when looking at a piece of code written in a high-level programming language, not everyone understands, however, when compared to assembly language and machine language, everyone must agree that high-level language. Much easier to understand.
- Can rely on existing processes to set up new processes
- There is no need to pay attention to low-level operations such as memory control
An example with a program written in C language
1 2 3 4 5 6 7 8 |
#include <stdio.h> int main() { printf("Hello, worldn"); return 0; } |
Write programs in Java
1 2 3 4 5 6 |
public class Hello_world { public static void main(String[] args) { System.out.println("Hello, world"); } } |
4. Which language is harder to learn? Low level programming language, of course
Of course, learning a low-level programming language is much more difficult than a high-level language. You need to pay attention to memory control too, so of course the amount of knowledge you need to learn will increase. And like the example I’ve just given above, learning to understand the source code of machine language and thinking needs “tremendous energy” is enormous. I don’t know how you feel, but I am absolutely not motivated enough to pursue this kind of language.
Surely we all agree that higher-level programming languages are friendly and closer. For example, in Python, Java, etc., the words #include, #define are all derived from English, just understand English, you can visualize their meaning roughly, right? The compiler has to translate the commands you write into machine language to make the computer execute.
5. Conclusion:
You must have understood the cascading standard in programming languages. For those who are just beginning to learn programming, I think you should try the high level programming language first. However, if you find lower-level programming languages much more interesting, or determined to conquer machine language, I will not prevent it. But please do not let yourself become a robot!
Well, speaking of robots, recently AI has been a very hot industry, right? Look for more on this interesting field if you want!