What is computer language

  
                  

There are many types of computer languages. In general, they can be divided into three major categories: machine language, assembly language, and high-level language.

Each time a computer performs an action, a step is performed in accordance with a program programmed in a computer language. The program is a collection of instructions to be executed by the computer, and the programs are all used by us. Master the language to write. Therefore, people must control the computer to issue commands to the computer through the computer language.

The language that the computer recognizes is only the machine language, which is the code consisting of 0 and 1. But usually people do not use machine language when programming, because it is very difficult to remember and recognize.

There are currently two general forms of programming languages: assembly language and high-level languages.

The essence of assembly language is the same as that of machine language. It is directly operated on hardware, but the instruction uses an abbreviated identifier, which is easier to identify and remember. It also requires the programmer to write each step of the specific operation in the form of a command. An assembler usually consists of three parts: instructions, directives, and macros. Each instruction of the assembler can only correspond to a very small action in the actual operation process, such as moving and incrementing. Therefore, the assembler source program is generally verbose, complicated, error-prone, and requires more computers to be programmed in assembly language. Expertise, but the advantages of assembly language are also obvious. The operations that can be done in assembly language are not realized by general high-level languages, and the executable files generated by the source program are not only small, but also very fast.

High-level languages ​​are the choice of most programmers today. Compared with assembly language, it not only synthesizes many related machine instructions into a single instruction, but also removes the details related to the specific operation but not related to the completion of the work, such as using the stack, registers, etc., which greatly simplifies the instructions in the program. . At the same time, programmers do not need to have too much expertise because of the many details omitted.

High-level language is mainly relative to assembly language, it does not specifically refer to a specific language, but includes many programming languages, such as the current popular VB, VC, FoxPro, Delphi, etc. The syntax and command format of these languages ​​are different.

Programs written in high-level languages ​​cannot be directly recognized by computers and must be converted to be executed. They can be divided into two categories according to conversion methods:

Interpretation class: Execution mode is similar to us In daily life, "simultaneous translation", the application source code is executed by the corresponding language interpreter "translation" into the target code (machine language), so the efficiency is relatively low, and can not be generated independently The executable, the application can not be separated from its interpreter, but this way is more flexible, you can dynamically adjust and modify the application.

Compilation class: Compilation means that the source code of the program is translated into the target code (machine language) before the application source program is executed, so the target program can be executed independently from its local environment. More convenient and efficient. However, once the application needs to be modified, it must first modify the source code, and then recompile and generate a new object file (*.OBJ) to execute. Only the target file has no source code, and the modification is inconvenient. Most programming languages ​​are now compiled, such as Visual C++, Visual Foxpro, Delphi, and so on.

Copyright © Windows knowledge All Rights Reserved