9.4 compiler theory understanding

1) Description of the compiler and interpreter, contact the differences of the assembler.

A: The compiler is not language processing program, consists of two parts, which are compiled and run. The high-level language compiler source code is translated into a one-time target program, each time the program is executed, as long as the target program.

Translation program refers to the translation of high-level language source code into machine language machine can recognize the program.

The assembler is a language translation program that translates assembly language source code into machine language program.

The difference between the compiler and assembler of: a high-level language, the target language is translated into low-level language, such a translation program called a compiler. If the source language is assembly language and the target language is the machine language, such a translation program called assembler.

2) compilation process, including the main function of which several main stages and each stage.

A: The compilation process includes six stages, namely, lexical analysis, syntax analysis, semantic analysis and code generation, code optimization, and target code generation.

Lexical analysis: high-level language source code will be scanned and decomposed in the form of a character stream, identify each word, the last word to the output stream form.

Parsing: on the basis of the word flow sequence in lexical analysis broken down into various types of grammatical phrases. This phrase is also known as grammar grammar units, generative grammar tree.

Semantic analysis: whether through semantic analysis of the review process spanning a semantic error in error, information was collected for the code generation phase type.

Intermediate code generation: after work parsing and semantic analysis phase, some compilers will become a source internal representation form, which is called intermediate code.

Code optimization: the intermediate code conversion or transformation, so that more efficient object code.

Object code generation: intermediate code into the instruction code on the absolute or relocatable machine specific instruction code or assembler instruction code.

3) Description of the difference between the interpreter and compiler.

A: The compiler is not language processing program, consists of two parts, which are compiled and run. The high-level language compiler source code is translated into a one-time target program, each time the program is executed, as long as the target program. Run refers to the execution of the target program.

Interpreter is a translation program that will source as input and execute it, explain the side edge to perform, will not generate the target program, you can achieve the same functionality compiler can perform.

The biggest difference between the two will not have to explain the target program during program execution, but rather interpreted source code itself, as defined in the source language.

4) understand the new open-source compiler Huawei Ark ( https://www.openarkcompiler.cn/home), understand and talk about its basic ideas and technology route, as well as its Android software ecosystem will be affected. 

A: Multi-language joint: the joint compilation of code in different languages ​​in the same application, joint optimization, eliminate performance "gap" between the language, optimized to reduce costs for developers.

Lightweight runtime, capacity and capacity enhancement is achieved by optimizing compiler language, application runtime overhead is smaller.

Hardware and software co-: compiler and chip hardware and software co-optimization, give full play to the hardware energy efficiency, better application experience.

Multi-platform support: Support for a variety of terminal equipment platform compile and run, providing easy development and deployment strategy based on device characteristics, improve development efficiency.

The current Android using Java as a programming language, easy to develop, but the code will not be compiled directly into machine language, a considerable part of the code requires temporary synchronization compiled by the virtual machine on the phone when the program is running, affect the efficiency of program execution. Huawei's Ark static compiler compiler has taken the way, it is the first to replace the static compiler Android virtual machine model.

Huawei's Ark machine code compiler uses the full implementation of efficient operational procedures, further optimized architecture, performance has improved significantly. Compared with the previous fluency, by the system program compiler Huawei Ark, fluency operation, response speed, third-party applications have been a smooth operation of the lift. Effective solution Andrews procedures "to explain edge side execution" inefficiencies

 

Guess you like

Origin www.cnblogs.com/Azan1999/p/11461280.html