plt

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 #

递归

July 24, 2022
plt

递归 # (define (sum n) (if (zero? n) 0 (+ n (sum (- n 1))))) ; not tail recursive 尾递归 # (define (tail-sum n [acc 0]) (if (zero? n) acc (tail-sum (- n 1) (+ n acc)))) ; tail recursive

Racket

July 6, 2022
plt

Interned # 基本数据类型 # Symbols # 不可变字符串

编程语言语法

June 4, 2022
plt

BNF # Backus-Naur form (BNF),用于描述计算机编程语言的语法规则