Home >Backend Development >Python Tutorial >Is python an assembly language?
Is python an assembly language? The essence of this problem is the concept of high-level language and low-level language. Assembly is a data machine language, while Python is a high-level programming language.
#So what are high-level languages and low-level languages?
The original computer programs were represented by sequences of 0s and 1s. Programmers directly used machine instructions without translation. They could execute the results by punching holes in the paper tape. Later, in order to facilitate memory, machine instructions represented by sequences of 0 and 1 were all mnemonic symbols. These mnemonics that corresponded one-to-one to the machine instructions became assembly instructions, and thus the assembly language was born. Both machine instructions and assembly instructions are machine-oriented and are collectively called low-level languages. Because it is a mnemonic for machine instructions for a specific machine, assembly language cannot be independent of the machine (specific CPU architecture). But assembly language also needs to be translated into machine instructions before it can be executed. Therefore, there is also a method of translating assembly language running on one machine into machine instructions running on another machine, and that is cross-assembly technology.
High-level language is a computer language that starts from the perspective of human logical thinking. The level of abstraction is greatly improved. It needs to be compiled into target code on a specific machine before it can be executed. A high-level language statement often requires several machine instructions. Finish. The machine-independent nature of high-level languages is achieved by compilers generating different object codes (or machine instructions) for different machines. Specifically speaking, to what extent should a high-level language be compiled? This is related to the compilation technology. It can be compiled into directly executable target code, or it can be compiled into an intermediate representation, and then obtained by different machines and System to execute, this situation usually requires a supporting environment, such as the support of an interpreter or a virtual machine. Java programs compiled into bytecode and then executed by virtual machines on different platforms are good examples. Therefore, saying that a high-level language does not depend on the machine means that the program itself of the high-level language remains unchanged on different machines or platforms, and the target code compiled by the compiler adapts to different machines. In this sense, through cross-assembly, some assemblers can also achieve portability between different machines, but the portability obtained through this approach is far less convenient and practical than high-level languages.
Python is a computer programming language. It is an object-oriented dynamic type language that was originally designed for writing automated scripts (shells). With the continuous updates of the version and the addition of new language features, it is increasingly used for the development of independent and large-scale projects.
The above is the detailed content of Is python an assembly language?. For more information, please follow other related articles on the PHP Chinese website!