General Course Information
Instructor: Lionel Parreaux
This course is centered on the theory and practice of designing compilers for general-purpose programming languages. In the projects, you will individually implement each part of a compiler for Amy, our toy language. Then, in a group project, you will implement an additional Amy feature of your choice. A final exam will be held to test your acquisition of the more theoretical knowledge, which you should have practiced during tutorial sessions.
This course can be used to fulfill COMP elective credits in the Software and Database area.
Resources
Lab/project resources
Teaching Staff
Instructor
Lionel Parreaux (parreaux@ust.hk)
Teaching Assistants
- Tony (Chun Yin) Chau (cychauab@connect.ust.hk)
- Mark (Pui Hei) NG (phmng@connect.ust.hk)
Office Hours
It is best if you can contact us in advance if you plan to come by, as we may not be physically present at our desks at all times during the week.
Schedule
TBA
Resources for Learning Scala
The Scala 3 Online Book
https://docs.scala-lang.org/scala3/book/introduction.html
- A Taste of Scala
- Domain Modeling/FP Modeling
- Functions
- Scala Collections
- Functional Programming
- Types and the Type System
Grading Scheme
Letter grade
-
Projects: 60%
- Five mini-projects worth 12% each
- One optional project which can make up for at most half of the marks lost in the mini-projects
-
Exam: 40%
Syllabus
Here are the general topics that this course will cover:
- Introduction & review of formal languages
- Lexical analysis
- Syntactic analysis (parsing)
- Name analysis
- Type checking
- Type inference
- Code generation
- Optimization
Policy for GenAI in Assessments
We generally do not allow the use of generative AI tools in this course. However, the use of inline code suggestions through tools like Copilot is permitted.
Reference Material
There are several standard textbooks for compilers, but we do not really follow any of them.
-
Andrew W. Appel, Jens Palsberg. Modern Compiler Implementation in Java (2nd Edition). Cambridge University Press, 2002
-
Aho, Sethi, Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley, 1986
This is also a nice
- Torben Mogensen. Basics of Compiler Design. http://hjemmesider.diku.dk/~torbenm/Basics/, 2010
Much of the lecture, tutorial, and labs material was reused from Viktor Kuncak’s course from EPFL, with his approval. Other important contributors to this material are Georg Schmid and Romain Edelmann.