The tiniest compiler book I have ever written. It covers all steps in the compilation process from high level language (T3X) to executable (ELF). Lots of diagrams, lots of code, zero theory. The tour through the compiler itself spans less than 100 pages. All code in the book is provided under the CC0 license (public domain). It can be downloaded below."
Practical Compiler Construction
This book offers a tour through the full compiler for a clean and sane subset of the C programming language (C89), covering lexical analysis, parsing, semantics, code generation, optimization, and runtime support, including lots of clarifying annotations and diagrams. The SubC compiler discussed in the book is in the public domain and can be downloaded below.
Kilo LISP, a kilo byte-sized LISP system
Kilo LISP is a purely symbolic LISP system that runs in 64K bytes of memory. It is written in C89 and compiles fine using SubC (below), Turbo C, or any modern C compiler. The code is about 25K bytes of comprehensible C and LISP.
The SubC Compiler
SubC is a clean, fast, and simple compiler for a subset of C89 that can compile itself on various BSDs, Linux, Windows, and other systems. It also cross-compiles to DOS. Its code is in the public domain.
The T3X Compilers
T3X is a small, portable, procedural, block-structured, recursive, almost typeless, and to some degree object-oriented programming language. It targets the Tcode machine, the 8086 under DOS, and the 386 and Alpha processors under Unix.
T3X9 is a tiny, block-structured, procedural language. Its compiler can compile itself in the blink of an eye (0.05s on a 750MHz notebook). It currently generates ELF executables for FreeBSD-x86. T3X9 is a subset of T3X.
The XT3X Compiler and Virtual Machine
A T3X9 compiler and Tcode machine extended with functions for X11 graphics and OSS sound. Intended for writing simple video games as they were ubiquituos in the 1970's and 80's."
Disclaimer: I am slightly biased towards small compilers -- but, that being said, there's a ton of other fascinating things on this page...
"Write Your Own Compiler
The tiniest compiler book I have ever written. It covers all steps in the compilation process from high level language (T3X) to executable (ELF). Lots of diagrams, lots of code, zero theory. The tour through the compiler itself spans less than 100 pages. All code in the book is provided under the CC0 license (public domain). It can be downloaded below."
Practical Compiler Construction
This book offers a tour through the full compiler for a clean and sane subset of the C programming language (C89), covering lexical analysis, parsing, semantics, code generation, optimization, and runtime support, including lots of clarifying annotations and diagrams. The SubC compiler discussed in the book is in the public domain and can be downloaded below.
Kilo LISP, a kilo byte-sized LISP system
Kilo LISP is a purely symbolic LISP system that runs in 64K bytes of memory. It is written in C89 and compiles fine using SubC (below), Turbo C, or any modern C compiler. The code is about 25K bytes of comprehensible C and LISP.
The SubC Compiler
SubC is a clean, fast, and simple compiler for a subset of C89 that can compile itself on various BSDs, Linux, Windows, and other systems. It also cross-compiles to DOS. Its code is in the public domain.
The T3X Compilers
T3X is a small, portable, procedural, block-structured, recursive, almost typeless, and to some degree object-oriented programming language. It targets the Tcode machine, the 8086 under DOS, and the 386 and Alpha processors under Unix. T3X9 is a tiny, block-structured, procedural language. Its compiler can compile itself in the blink of an eye (0.05s on a 750MHz notebook). It currently generates ELF executables for FreeBSD-x86. T3X9 is a subset of T3X.
The XT3X Compiler and Virtual Machine
A T3X9 compiler and Tcode machine extended with functions for X11 graphics and OSS sound. Intended for writing simple video games as they were ubiquituos in the 1970's and 80's."
Disclaimer: I am slightly biased towards small compilers -- but, that being said, there's a ton of other fascinating things on this page...