← 返回专栏列表

Essentials of Compilation 专栏

共 13 篇文章

1. Essentials of Compilation:前言与致谢

本篇翻译原书 Preface 与 Acknowledgments,说明本书的 incremental compiler 教学路线、章节依赖、实现环境与写作背景。

2. Essentials of Compilation:预备知识

本章回顾实现 compiler 所需的基本工具:AST、grammar、pattern matching、recursive function、interpreter,以及一个 partial evaluator 示例。

3. Essentials of Compilation:整数与变量

本章把包含整数和 local variable 的 编译到 x86-64,并逐步建立从高层 AST 到 assembly 的 compiler pipeline。

4. Essentials of Compilation:Register Allocation

本章把前一章暂时放在 stack 上的 variable 尽可能分配到 registers,并用 liveness analysis、interference graph 和 graph coloring 实现 register allocation。

5. Essentials of Compilation:布尔值与条件分支

本章在 上加入 Boolean、logical operation 和 ,并说明 type checking 与 conditional control flow 如何改变 compiler pipeline。

6. Essentials of Compilation:循环与数据流分析

本章加入 imperative language 的 loops、mutable local variables 和 sequencing,并用 dataflow analysis 处理 loops 带来的 cyclic control flow。

7. Essentials of Compilation:元组与垃圾回收

本章把 tuple 放入 heap,并实现 copying garbage collector;compiler 需要与 runtime 协作,准确找到仍然 live 的 tuple roots。

8. Essentials of Compilation:函数

本章在 tuple / loop compiler 之上加入 top-level function definition 与 function application,并处理 function pointer、calling convention、tail call 和 function reference。

9. Essentials of Compilation:词法作用域函数

本章把 lexically scoped 转换为 top-level function 与 flat closure,并处理 assignment 与 closure lifetime 的冲突。

10. Essentials of Compilation:动态类型

本章把 dynamically typed 编译为带显式 、、 和 runtime tag 的 。

第 1 / 2 页 · 共 13 篇