Hello World From Scratch
summary
Shows a line-by-line build from source text to running binary: preprocessor expansion, lexer → tokens, parser → AST, semantic checks, lowering to LLVM IR, target-specific instruction selection, scheduling and graph-color register allocation, and assembler output into an ELF object file with relocations. Demonstrates C++ details: vtable and name-mangling layout, global constructors via _start and atexit, and a concrete micro-optimization that replaces a 5-byte immediate move with a 2-byte XOR to save millions of bytes across real programs.
AI-written summary · about
chapters (17)
- 0:00Introduction to compiler
- 2:05The preprocessor stage
- 5:18Compiler front and back end
- 6:43Assembler and ELF format
- 10:55The linking process
- 12:20Lexical analysis
- 17:51Parsing and syntax trees
- 25:17Semantic analysis
- 27:28Intermediate representation
- 31:56Optimization techniques
- 34:10Code generation
- 38:49Register allocation
- 41:42Target specific optimizations
- 44:12Final assembly output
- 47:25Linking the final executable
- 49:29C++ specific complexities
- 53:42Conclusion and Q&A
related talks
01h 21mHello World from Scratch
10mA quick view into a compiler
29mUnderstanding 'Hello World'
52mA bird's eye view of a compiler
01h 04mThe Bits Between the Bits: How We Get to main()
01h 01mHow to start a program
01h 00mFrom Program to Process - What Happens After the Compiler
01h 03mBack to Basics: Compiling and Linking
