0 day streak

Compilers

A compiler is a program that translates code people can read into instructions a machine can run. It works in stages: it chops the text into tokens like keywords, names and symbols; parses them into a syntax tree that captures structure, such as which statements belong to which if; checks types and lowers the tree into a simpler intermediate form where most optimizations happen; and finally chooses real machine instructions. Some languages compile ahead of time into a binary, while others use a JIT, a just-in-time compiler that translates during the run and specializes the code that runs most. Knowing the pipeline explains error messages and why optimized builds can behave differently.

In this lesson: Type code and see tokens, then the AST, then IR, then assembly.