|
This PDF contains a collection of lecture notes used in UFMG's Compiler Construction course. This undergraduate-level class covers the basics of compiler construction, including the design and implementation of the front end, middle end, and back end of a compiler. The course generally follows the guidelines outlined in the ACM Computer Science Curricula for programming languages. The course is project-oriented: students are tasked with building an interpreter and a compiler for a purely functional subset of SML/NJ. The course structure closely follows the approach presented by Robert Nystrom in his book, Crafting Interpreters. However, instead of using an object-oriented language, we use a functional one. Additionally, instead of targeting a stack-based virtual machine, we target RISC-V. The material in this book was curated with the assistance of two LLMs: ChatGPT and Gemini. The original lecture notes were designed to be question-oriented. To leverage the LLMs, these questions were provided to them with a draft answer and their responses were carefully edited for accuracy and clarity (example). The content of the book is largely derived from publicly available examples, including those found in research papers and forums. This book is a work in progress, so typos and errors may be present. If you have suggestions, comments, or spot any mistakes, please contact Fernando Pereira at pronesto@gmail.com. |
Table of Contents
|