A compiler is a software system that translates a program written in one language (source language) into a semantically equivalent program written in another language (target language). The goal of this course is to learn principles of compiler construction and related programming language theories.
We will use OCaml programming language for our programming exercises. This instruction assumes that you are using the Linux command line interface.
To install OCaml, simply copy and run the following commands in the terminal.
$ chmod +x setup/install_ocaml_mac.sh; ./setup/install_ocaml_mac.sh; eval $(opam env)
To install OCaml, simply copy and run the following commands in the terminal. I checked that the following commands successfully work for the clean docker image python:3.9.19-slim
.
$ chmod +x setup/install_ocaml_ubuntu.sh; ./setup/install_ocaml_ubuntu.sh; eval $(opam env)
For Windows users, I recommend using WSL.
After setting up WSL, simply copy and run the following commands in the terminal to install OCaml.
$ chmod +x setup/install_ocaml_ubuntu.sh; ./setup/install_ocaml_ubuntu.sh; eval $(opam env)
For any OS, if the installation was successful, you should see the message The OCaml toplevel, version 5.1.1
by running the command ocaml --version
in the terminal.
$ ocaml --version
The OCaml toplevel, version 5.1.1
# | Date | Topics | Recommended Reading |
---|---|---|---|
0 | 9/2 | Course Overview | CPTT Ch.1 |
1 | 9/2 | Overview of Compilers | |
2 | 9/4 | Lexical Analysis (1) | CPTT Ch.3.3 |
3 | 9/9 | Lexical Analysis (2) | CPTT Ch.3.4, 3.6, 3.7.5 |
4 | 9/11,9/23 | Lexical Analysis (3) | CPTT Ch.3.7.4, 3.7.1 |
- | 9/25,9/30,10/2 | Functional Programming in OCaml | Exercise solutions |
5 | 10/7 | Syntax Analysis (1) | CPTT Ch.4.2 |
6 | 10/14,10/16 | Syntax Analysis (2) | CPTT Ch.2.2, 4.3, 4.4 |
7 | 10/21,10/23 | Syntax Analysis (3) | CPTT Ch.4.5, 4.6 |
- | 10/28 | Mid-term Exam | |
8 | 11/4 | Syntax Analysis (4) | CPTT Ch.4.8 |
9 | 11/6 | Lexer & Parser Generators | CPTT Ch.4.9, Tutorial for ocamllex, ocamlyacc |
10 | 11/11 | Semantic Analysis (1) | |
- | 11/13 | Undecidability, Halting Problem | |
11 | 11/13,20 | Semantic Analysis (2) | SAA Ch.7.1 |
12 | 11/25 | Semantic Analysis (3) | |
13 | 11/25 | Semantic Analysis (4) |
By registering for this course, I will assume you agree with the policy below.
My lecture slides are based on the slides from the following courses.