Understanding the Go Compiler
summary
Covers the Go compiler pipeline for Go 1.20 by compiling a hello world through scanner → parser → AST → type checker → package IR → SSA, then SSA optimizations (inlining, escape analysis, CSE, dead-code elimination, lowering) to architecture-specific assembly, link with the runtime, and produce a runnable binary that performs a kernel write syscall. Shows concrete code-to-IR examples, the textual SSA and lowered assembly outputs, notes where passes run multiple times, and points to go/ssa, compiler READMEs and strace to observe the result.
AI-written summary · about
chapters (13)
- 0:00Start
- 3:09PHASES OF THE GO COMPILER
- 7:48SAMPLE SCANNER CASES
- 10:13THE PARSER
- 15:03SAMPLE PARSER FUNCTIONS
- 16:27TYPE CHECKER
- 23:17SSA (STATIC SINGLE ASSIGNMENT)
- 28:46SSA PASSES
- 32:23MACHINE CODE GENERATION
- 36:17THE KERNEL AND THE STDOUT
- 38:10SUMMARY
- 39:28THE ILLUSTRATIONS OF THE TALK
- 40:42REFERENCES








