当前位置:网站首页>Principles, language, compilation, interpretation
Principles, language, compilation, interpretation
2022-07-02 15:07:00 【An engineering man who wants to be a writer】
Preface
Study Principles and language of computer Content !
List of articles
One 、 Hardware and software
Hardware : Things that can be seen and touched , for example , mouse 、 keyboard 、 Monitor .
Software : Things that can't be seen or touched , for example , Programs installed on the computer ,qq And wechat .
Two 、 The three principles
Computers are essentially performing :“ Input -> operation -> Output ” step , Most of what computers do is these three steps .
for example , Enter information on the keyboard , Click the relevant buttons of some programs to calculate , And then on the screen result .
for example , See a movie : Search for ( Input )-> Networking requests ( operation )-> Show search results ( Output ).
Input 、 Operations and output operations are data .A set of instructions and data is a program .
Program : The program is Instructions and data Set , Instructions are also a special kind of data .
Instructions : Do not participate in the operation , It's about controlling operations , An instruction is an order . Control how the computer inputs , operation , Output . Analogy work in which the leader gives you orders , Arrange a task , You are responsible for completing . Every line of code we write can be regarded as an instruction to the computer , Instructions can be combined .
data : It can be divided into two kinds , Input data and output data . No matter how complicated the program is , It is essentially a collection of data and instructions .The information processed by the computer is all digital -> Binary system -> Data is stored in memory in binary form .
written words , video , How to express colors in numbers ?
Color :RGB.
written words : You need to use numbers to represent the computer to understand , By character encoding .
Computers only know numbers , That only needs to show the information as a number one A corresponding mapping table is not enough ?ASCIICode is to convert words into numbers recognized by computer .
3、 ... and 、 Computer language
Computer language is for both sides , One is Computer , The other is people , It is a connection between computer and human bridge .
Or the language is computer friendly , Or be friendly . Friendly to people is called High-level language , Computer friendly is called Low level language .
- Low level language
- machine language : Machine language is also called native code , Is the native language of computer (
0and1Two programming languages written in binary numbers ), Can be directly recognized by the computer , No additional translation is required , Computer friendly . - assembly language : take
0and1Put together data that contains specific instructions and give it a name , Use English letters to indicate , This kind of thing is called Mnemonic symbol .
- machine language : Machine language is also called native code , Is the native language of computer (
- High-level language
Four 、 Compilation and interpretation
clear : Whether compiling or interpreting , It's all... In essence translate , Translation is to translate a program into another state . for example , Translate English into Chinese , Translate the source code of the program we wrote into the machine language that the computer can execute, that is, the form of binary ( The ultimate purpose of Translation ), To complete the work .
- compile
It is to translate all source code into machine language at one time , Fast execution . - explain
Not a one-time translation , When the program is executed , Translate the source code into machine language one by one , Slow execution . - difference
compile : After the program is compiled, another set of Storable Code for . for example ,javaCompile and generate bytecode , Is storable .
explain : Explain and execute , Explain one thing and execute another , The process is Do not generate storable Code for
summary : compile When translating and executing Separate Of , and explain It is Sync On going
5、 ... and 、 Translation and execution
- Translated Purpose : Generate code in another format , take
AbecomeBThe process of ,BCan be executed directly by the computer . - compile : One step in place , Directly translate the source code into the target machine code ( machine language ), It can run directly . The emphasis is on one-off , Translate the source code directly into machine code , If you want to run, you can directly read the run .
- explain :
AbecomeB,BIt's not machine language , It cannot be directly executed by the computer , It belongs to a kind of intermediate code , It needs to be translated into target machine code again ( machine language ) To be executed by a computer . The process of retranslation is generally interpretation , The emphasis is to translate again , That is to translate one by one , Translate and execute . - perform : The ultimate goal of execution is to run in the computer , To run, you need to perform the previous translation process .
5、 ... and 、 The two forms are combined
- Compile implementation : It is to translate the source program into the target machine code in one step , And then run directly .
- Explain to perform : Intermediate code to be generated , It's not the source program anymore , Then translate the intermediate code one by one into the target machine code , Translate one , To perform a , That is, execute while translating . for example ,
java, The intermediate code isclassfile , Bytecode .javaThe original document :xx.java, Generate intermediate code after compilation :xx.classBytecode file , It needs to be interpreted into the target machine code again for execution .
6、 ... and 、 compile
python First translate into intermediate code , Then give it to a specific ·python· The interpreter interprets and executes the generated object code , And then run .c c++ It's a compiled language , Translate the source program at one time ( compile ) Into machine code , And then run .
边栏推荐
- [QNX Hypervisor 2.2用户手册]6.3 Guest与外部之间通信
- 关于网页中的文本选择以及统计选中文本长度
- Huawei interview question: no palindrome string
- kityformula-editor 配置字号和间距
- Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
- Why can't programmers who can only program become excellent developers?
- Ad20 cannot select the solution of component packaging in PCB editor
- Obsidian installs third-party plug-ins - unable to load plug-ins
- Tmall product details interface (APP, H5 end)
- 【题解】Educational Codeforces Round 82
猜你喜欢
随机推荐
LeetCode 2320. 统计放置房子的方式数
LeetCode 209. 长度最小的子数组
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
Why can't programmers who can only program become excellent developers?
微信小程序使用towxml显示公式
Slashgear shares 2021 life changing technology products, which are somewhat unexpected
C语言中的printf函数和scanf函数
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
Onnx+tensorrt: write preprocessing operations to onnx and complete TRT deployment
【NOI模拟赛】刮痧(动态规划)
taobao. logistics. dummy. Send (no logistics delivery processing) interface, Taobao store delivery API interface, Taobao order delivery interface, Taobao R2 interface, Taobao oau2.0 interface
如何用 Sysbench 测试 TiDB
About text selection in web pages and counting the length of selected text
tmall. product. schema. Get (product information acquisition schema acquisition), Taobao store upload commodity API interface, Taobao commodity publishing interface, Taobao commodity upload API interf
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
Tmall product details interface (APP, H5 end)
C# richTextBox控制显示最大行数
LeetCode 2310. The number of digits is the sum of integers of K
Dragonfly low code security tool platform development path
geoserver离线地图服务搭建和图层发布









