【极致中配】加州伯克利分校 CS164 编程语言与编译器 Fall 2025
以增量方式用 OCaml 从零构建一个编译器:从表达式、布尔、条件、变量到函数、闭包、尾调用优化、解析与代码优化。
- 难度
- 难度 4/5 — 需扎实编程与递归/数据结构基础,逐步实现完整编译器,工程量大
- 适合人群
- 有编程基础、想动手实现编译器/解释器的计算机专业学生
- 前置要求
- 数据结构与算法(递归、树、抽象语法树的处理)、函数式编程(课程用 OCaml,需适应模式匹配与不可变数据)、汇编与计算机组成(生成目标代码,需理解寄存器、栈、指令)、编程基础(至少一门系统性编程课经验)
- 课程规模
- 26 讲 · 2044播放
主题覆盖
编译器与解释器S-表达式表达式与语句布尔与条件二元运算let 变量绑定错误处理输入输出交互函数与尾调用优化解析与正则表达式一等函数与闭包代码优化
课程大纲(26 讲)
- P1 · Lec 01: What is a Compiler?49 分钟
- P2 · Lec 02: Reflection Activity Ocaml Custom Types48 分钟
- P3 · Lec 03 - Expressions vs Statements Immutability basics48 分钟
- P4 · Lec 04 - S-Expressions; Unary Operations52 分钟
- P5 · Lec 05 - Compiler Correctness; Booleans Interpreter51 分钟
- P6 · Lec 06 - Booleans (Compiler)47 分钟
- P7 · Lec 07 - Tagging activity; Conditionals47 分钟
- P8 · Lec 08 - Binary Operations47 分钟
- P9 · Lec 09 - Naming Expressions (Let)42 分钟
- P10 · Lec 10 - Let expressions contd; Pairs48 分钟
- P11 · Lec 11 - Handling Errors46 分钟
- P12 · Lec 12 - Interacting with the environment Input43 分钟
- P13 · Lec 13 - Interacting with the environment output39 分钟
- P14 · Lec 14 - Functions!47 分钟
- P15 · Lec 15 - Functions cont'd47 分钟
- P16 · Lec 16 - Tail Call Optimization47 分钟
- P17 · Lec 17 - Parsing47 分钟
- P18 · Lec 18 - Regular Expressions49 分钟
- P19 · Lec 19 - Parsing cont'd44 分钟
- P20 · Lec 19.5 - Parsing - Part 3, Reproduced for Fall2513 分钟
- P21 · Lec 20 - First-Class Functions - Part 1, Reproduced for Fall 2544 分钟
- P22 · Lec 21 - First Class Functions Part 249 分钟
- P23 · Lec 22 - First Class Functions Part 344 分钟
- P24 · Lec 23 - Optimization45 分钟
- P25 · Lec 24 - Optimization Part 241 分钟
- P26 · Lec 25 - Esoteric programming languages33 分钟
本课程卡由 AI 生成,可能存在误差,欢迎反馈。