What is programming language
Source: Shangpin China |
Type: website encyclopedia |
Time: 2015-06-17
Programming language is the artificial language used by people to write computer programs Beijing website production Language. The generation and development of program language is rooted in the development process of computer technology, and is an important part of computer technology. After more than half a century of development, hundreds of programming languages have emerged, all of which have their own characteristics, some of which have died out, while the remaining ones have been constantly improved and applied in different fields. Some languages are universal, while others are designed for specific fields, called Domain Specific Language (DSL), Its basic design idea is to seek expertise rather than perfection. Programming languages are sometimes called programming languages. According to its abstract level, the programming language can be divided into low-level language and high-level language. The low-level language includes machine language and assembly language, while the high-level language is much richer. 1. Machine language and assembly language officer Machine language is a set of machine instructions expressed in binary code that can be directly recognized and executed by the computer. It is the operation function that the computer designer gives the computer through the hardware structure. Therefore, the machine language is closely related to the specific hardware structure. For example, a machine language program that multiplies two integers and prints the operation result is shown in Table 7-1. To write programs in machine language, programmers should first memorize all the instruction codes of the computer used and the meaning of the codes. At the same time, the programmer insists on handling the storage allocation and input/output of each instruction and data by himself, and also needs to remember the state of the work unit used in each step of the programming process. At that time (around 1950), what kind of work was programming? At that time, the program was not "written" as it is today, and the program was not written on paper, but punched irregular holes in the paper tape (modifying the program is patching the paper tape). The programmer needs to convert the instructions to the computer into binary numbers first, and then convert the binary numbers into these holes. Each hole represents a signal to the computer. Hundreds of holes drive the computer to do an action, and thousands of holes form an instruction! Obviously, programs written with machine instructions are difficult to read and understand, and if the program goes wrong, it is also very difficult to check and eliminate errors. In order to overcome the shortcomings of machine language programming that is difficult to read, compile, remember, and make mistakes, people replace the instruction code with English abbreviations, letters, numbers, and other symbols that are similar to the actual meaning of the code instructions, and then assembly language comes into being. In assembly language, ADD means addition, SUB means subtraction, MUL means multiplication, etc. For example, the program to multiply two integers and print out in an assembly language is shown in Table 7-2. Although the efficiency and readability of programs written in assembly language have been improved, it is still a machine oriented language in essence, which is cumbersome and time-consuming to use, and has poor versatility. Assembly language is still a low-level language, which is suitable for compiling those parts of system software directly related to hardware and some process control software. Since the computer does not know the literal symbols of assembly language, a special program is needed to translate these symbols into machine language in binary form, which is called assembly program. 2. Business level language officer Both machine language and assembly language are hardware oriented. The excessive dependence of the language on the machine is not conducive to programming and transplantation. Therefore, people have developed a variety of high-level programming languages (referred to as high-level languages). In high-level languages, people use symbols that are more similar to natural languages for expression, such as print for print output, "+" for addition, etc. For example, the program written in C language to realize the multiplication and output of two integers is shown in Table 7-3. Of course, the computer cannot directly recognize high-level language programs, so high-level language programs need to be translated into instructions that the computer can execute before execution. 3. Compilation and interpretation A program written in a high-level language or assembly language is called a source program, which cannot be directly executed on a computer. If the source program is written in assembly language, it needs to be translated into object program by assembly program, and then linked with other necessary object programs before execution. If the source program is written in a high-level language, the corresponding compiler (also known as the compiler) needs to translate it into the target program and link it before execution, as shown in Figure 7-1. High level language programs can also be run by interpretation, which requires an interpreter. Interpreter is also called interpreter. It either directly interprets and executes the source program, or first translates the source program into some intermediate representation, and then interprets and executes it. The difference between interpreter and compiler is that the compiler first translates the source program into the target language program, generates the executable program after linking, and then runs the executable program on the computer. That is, in the compilation mode, the machine runs the executable program with the same price as the source program, and neither the source program nor the compiler participates in the execution process of the executable program; In the interpretation mode, both the interpreter and the source program (or its intermediate representation) should participate in the running process of the program, and the control of the running program is in the interpreter. In other words, the interpreter does not produce an independent object program when translating the source program, while the compiler needs to translate the source program into an independent object program.
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).