First job: Understanding compiler theory

2. Job

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

Translator : translate high-level language source code into object code of the software.

Compiler : running after the first full compilation, such as there are C, C ++ and the like ; is an interpreter and a translator translate and execute the program, for example, JavaScript and Python.

Assembler : is the assembly language source code translated into machine language program .

The difference between the compiler and assembler : the period of "high-level language" translated into the target language such as assembly language or machine language like "low-level language", the process of translation program called compiler. If the source language is assembly language, machine language and the target language, this process is the translation program called assembler.

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

The main compilation process into four stages : pre-compilation process , the compiler optimizer , assembler ,  linker.

Precompiled process : the .c convert files into .i file .

Compiler optimization program : the .c / .h file into a .s file .

Assembler : the .s convert files into .o files  .

Linker : the .o convert the file into an executable program .

 

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

The compiler is the high-level language into a low-level language, and the interpreter is to a high-level language into line interpreter and control the computer to perform, then there will be the results, and then explain the next sentence.

 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 have any effect?

The basic idea:

Ark compiler for the first time in the areas of Java virtual machine to get rid of, but also the software first time in history the Java / C / C ++ and other mixed code is first compiled into machine code to run directly on the phone, to bid farewell to the Java JNI overhead, also bid farewell to the virtual GC application machine memory recovery process brought about dropped calls, the operator fluency increased dramatically. If the latest Android system is Harmony EMU, then the ark compiled by Andrews is high-speed rail system, a "renaissance number."

Huawei cell phone directly replace all the background services Android system-server by the Ark compiler, this one would have been sufficient to make Huawei EMUI step faster than other Android system.

Technology Roadmap:

The compiler java and C (JNI) a compiled executable file

Enter the user source code, wherein the first java language optimized, after converting it to the C language (the JNI), thereby improving efficiency.

influences:

Achieve unity among mixed-language representation and full static compilation, which kill the virtual machine, eliminating the JNI overhead, bid farewell to the GC memory recovery " intermittent " Caton, and many other expenses. Meanwhile, code optimization provides a broader stage for developers .

Guess you like

Origin www.cnblogs.com/hzxx/p/11457879.html