Welcome to COMP 3173

In this project, you will be required to implement a full-featured1 compiler for a simple programming language called ???(TBD). More specifically, you will implement the following components:

           ┌───────────┐    ┌──────────┐    ┌───────────┐    ┌───────────┐
           │   Lexer   ├───▶│  Parser  ├───▶│TypeChecker├───▶│Interpreter│
           └───────────┘    └──────────┘    └───────────┘    └───────────┘

By the end of this project, you will be able to:

  • Understand the detailed process of how a DFA works and how to implement it.
  • Understand how parser generator works and write your own a simple parser generator.
  • Understand how AST can be evaluated and how typechecking works.

Moreover, you will also learn some state of the art techniques used in the open-source compiler, such as how to make compiler diagnostics more user-friendly:

Error: Expect a bool guard in if expression
   ╭─[<unknown>:1:1]
   │
 1 │ if let a = 1 in a then 1 else 2
   │    ───────┬──────
   │           ╰──────── expect a bool
───╯
1

usually a “full-featured” compiler should include backend components like code generation, optimization, etc. But in this project, we will only focus on the frontend components.

Last Updated: 2024 Sep 03 01:18:56