当前位置:网站首页>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 ?ASCII
Code 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 (
0
and1
Two programming languages written in binary numbers ), Can be directly recognized by the computer , No additional translation is required , Computer friendly . - assembly language : take
0
and1
Put 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 ,java
Compile 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
A
becomeB
The process of ,B
Can 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 :
A
becomeB
,B
It'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 isclass
file , Bytecode .java
The original document :xx.java
, Generate intermediate code after compilation :xx.class
Bytecode 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 .
边栏推荐
- [noi Simulation Competition] scraping (dynamic planning)
- Key points of compilation principle examination in 2021-2022 academic year [overseas Chinese University]
- 可视化搭建页面工具的前世今生
- MFC CString to char*
- Solve the problem that El radio group cannot be edited after echo
- [apipost] tutorial
- Internet Explorer officially retired
- C语言中的算术运算及相关练习题
- Actual combat sharing of shutter screen acquisition
- 如何用 Sysbench 测试 TiDB
猜你喜欢
微信小程序使用towxml显示公式
【C语言】详解指针的初阶和进阶以及注意点(1)
MFC 定时器使用
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
. Net core logging system
LeetCode 2320. 统计放置房子的方式数
Full of knowledge points, how to use JMeter to generate encrypted data and write it to the database? Don't collect it quickly
CTO如何帮助业务?
Internet Explorer officially retired
学习使用php将时间戳转换为大写日期的方法代码示例
随机推荐
Slashgear shares 2021 life changing technology products, which are somewhat unexpected
IE 浏览器正式退休
LeetCode 2310. The number of digits is the sum of integers of K
php获取数组中键值最大数组项的索引值的方法
Niuke Practice 101
Why can't programmers who can only program become excellent developers?
Fatal: unsafe repository is owned by someone else
华为面试题: 没有回文串
taobao. trade. memo. Add (add remarks to a transaction) interface, Taobao store flag insertion interface, Taobao order flag insertion API interface, oauth2.0 interface
Li Chuang EDA learning notes 15: draw border or import border (DXF file)
Fundamentals of software testing
Xilinx Vivado set *. svh as SystemVerilog Header
MFC A对话框调用B对话框函数并传参
info [email protected]: The platform “win32“ is incompatible with this module.
[untitled] leetcode 2321 Maximum score of concatenated array
【题解】Educational Codeforces Round 82
C RichTextBox controls the maximum number of lines displayed
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
TiDB数据迁移工具概览
Jenkins Pipeline 应用与实践