Program compilation

Time:2021-4-10

catalog
  • The essence of procedure
  • The development of programming language
  • Essential differences of programming languages

https://www.bilibili.com/video/BV1UV411B7qU?p=7 note


The essence of procedure

  • Compiler transforms program code into CPU instruction / machine code;
  • Instructions are loaded into memory;
  • CPU reads / writes memory;
  • The CPU controls the hardware of the computer

CPU is an important component of CPU

  • Register, information storage
  • Arithmetic unit, information processing
  • The controller controls other devices to work

Memory & register

Memory and registers can be used to store things, but the registers are in the CPU, and the CPU can access it faster.

Examples of memory and register calls:
Calculation of data

int a = 1;
int b = a + 1

a. B is stored in the memory, the data will be sent to the register for calculation (+ 1), and then returned to the memory.


The development of programming language

  1. machine language
  2. assembly language
  3. high-level language
  • Assembly language and machine language are one-to-one correspondence, and each machine instruction has its corresponding assembly instruction;
  • The compilation was adoptedcompileGet machine language, machine language throughDisassemblyGet assembly language;
  • High level language can be compiled into assembly language / machine language, but assembly language / machine language can hardly be restored to high level language;
  • High level language can’t access register directly;

Essential differences of programming languages

JS / PHP code will eventually be converted into machine code, but you can’t see the machine code; the engine blocks these details.
Java is converted to bytecode and loaded by the JVM

  • Compiler language
    – C / C++ / OC / Swift
    -Easy to disassemble

  • Compiler language (virtual machine dependent)
    – Java / Ruby
    -Java is loaded bytecode by JVM
    -Virtual machine can be seen as a small operating system

  • scripting language
    – Python / JS / PHP
    -PHP is parsed by Ze (Zend engine)


Compiler language requires all pairs to be executed;
Script language is to scan and execute line by line. If there is an error in a certain line, it will continue to execute in the front and not in the back. It’s less efficient than compiled languages because it’s run time.


Recommended Today

Review of SQL Sever basic command

catalogue preface Installation of virtual machine Commands and operations Basic command syntax Case sensitive SQL keyword and function name Column and Index Names alias Too long to see? Space Database connection Connection of SSMS Connection of command line Database operation establish delete constraint integrity constraint Common constraints NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY DEFAULT […]