This repository contains the code accompanying the practice-oriented parts of the "Compiler Design and Implementation" series of lectures performed during the 2015/16 season of Budapest Swift Meetup.
The code usually closely resembles what has been written during the live coding sessions. Bug fixes, other improvements and modifications may be committed without notice, though.
The code is placed into the public domain; there is no warranty whatsoever.
Presentation slides in PDF and Keynote format are all available in the Slides
directory.
The code has evolved continuously, during each meetup. It now contains a lexer, a parser, an AST definition, a primitive AST-based "optimizer", an LLVM code generator, and a minimal runtime library for SwiSwi, our toy language being compiled.
-
Part 1: Introduction; Lexical Analysis
-
Part 2: Parsing (Syntactic Analysis)
-
Part 3: Semantic Analysis (in: Type Checking and Inference)
- Slides
- Code for type annotations
- (The AST already contains type inference code)
- Video (in Hungarian)
-
Part 4: Low-level Code Generation - lowering to LLVM IR
-
Part 5: Optimization
-
Part 6: Debugging and Runtime