|
| 1 | +================================ |
| 2 | +Welcome to Compiler Programming! |
| 3 | +================================ |
| 4 | + |
| 5 | +This site aims to bring together practical knowledge regarding the design and implementation of optimizing compilers |
| 6 | +and interpreters for Programming Languages. |
| 7 | + |
| 8 | +There are a number of books on Compilers and Interpreters however only a very few of them are accompanied by |
| 9 | +source code that implements the topics covered by the book. See below for a list of useful |
| 10 | +learning projects that do include source code. |
| 11 | + |
| 12 | +In recent years, thanks to LLVM, new programming language design has become a fertile space. New Language implementations |
| 13 | +tend to focus on the language front-end, leveraging LLVM as the back-end for code optimization and code generation. |
| 14 | +While this is beneficial if you only care about the language design aspects, it is unhelpful for the industry |
| 15 | +as a whole, because the back-end of an optimizing compiler is a very interesting component, with a rich history of |
| 16 | +algorithms and data structures, and is a subject worthy of study on its own. |
| 17 | + |
| 18 | +We will cover both front-end and back-end techniques. We will implement a small scale language as a way |
| 19 | +to learn various techniques, see what the common challenges are and how to address them. |
| 20 | +Language design not being our goal, we will keep the language as simple as possible so that it allows us to |
| 21 | +focus on important implementation issues. |
| 22 | + |
| 23 | +Initially we will start with a procedural language. Later we will add features such as closures from functional languages |
| 24 | +and classes and objects from OOP languages. We will also look at advanced front end techniques such as type inference and |
| 25 | +generics. |
| 26 | + |
| 27 | +The language will be statically typed to start with because this allows us to investigate the traditional compiler |
| 28 | +optimization pipeline. Dyamically typed languages have their own interesting engineering problems. |
| 29 | +We will eventually look at gradual typing and dynamic typing. |
| 30 | + |
| 31 | +Preliminaries |
| 32 | +============= |
| 33 | + |
| 34 | +.. toctree:: |
| 35 | + :maxdepth: 2 |
| 36 | + :caption: Preliminaries |
| 37 | + |
| 38 | + prelim-impl-lang |
| 39 | + |
| 40 | +Basic Front-End techniques |
| 41 | +========================== |
| 42 | + |
| 43 | +* Lexical analysis |
| 44 | +* Parsing |
| 45 | +* Abstract Syntax Trees |
| 46 | +* Type Systems |
| 47 | +* Semantic Analysis |
| 48 | + |
| 49 | +Basic Back-end techniques |
| 50 | +========================= |
| 51 | + |
| 52 | +* Stack based vs register based Intermediate Representation |
| 53 | +* Control flow graphs and Basic Blocks |
| 54 | +* Bytecode VM with simple garbage collection |
| 55 | + |
| 56 | +Basic Optimization techniques |
| 57 | +============================= |
| 58 | + |
| 59 | +* Dominators and Control Flow Graph |
| 60 | +* Data Flow Analysis, Type Lattices, Abstract Interpretation |
| 61 | +* Peephole Optimizations |
| 62 | +* Static Single Assignment |
| 63 | +* Sea of Nodes Representation |
| 64 | +* Code generation and Register Allocation |
| 65 | + |
| 66 | +Language Tools |
| 67 | +============== |
| 68 | + |
| 69 | +* Debuggers |
| 70 | +* Language IDEs |
| 71 | + |
| 72 | +Advanced Front-end techniques |
| 73 | +============================= |
| 74 | + |
| 75 | +* Type inference |
| 76 | +* Classes and objects |
| 77 | +* Closures |
| 78 | +* Exception handling |
| 79 | +* Gradual typing |
| 80 | +* Generics |
| 81 | + |
| 82 | + |
| 83 | +Some Useful Projects |
| 84 | +==================== |
| 85 | + |
| 86 | + |
| 87 | +Book Reviews |
| 88 | +============ |
| 89 | + |
| 90 | +.. toctree:: |
| 91 | + :maxdepth: 2 |
| 92 | + :caption: Reviews |
| 93 | + |
| 94 | + compiler-books |
| 95 | + |
| 96 | + |
0 commit comments