Interpreter

Interpreter

December 12, 2022
plt

Overview #

Scanning #

Source Code -> Token

词法分析,将源代码的一坨字符串变成有意义的 token 串

Parsing #

Token -> AST

IR #

intermediate representation

Code generation #

Bytecode #

p-code: portable code

Each instruction is often a single byte(8 bits) long

供虚拟机执行的代码(指令),而不是真正的机器码,由虚拟机去抹平不同cpu架构的差异

Virtual machine #

执行 bytecode

Interpreter #

Transpiler #

转译器,例如各种转译为 javascript 的语言

Just in time #