University Subjects

COMP3131: Programming Languages and Compilers

COMP3131: Programming Languages and Compilers

University
University of New South Wales
Subject Link
View Subject

Subject Reviews

anomalous

2 years ago

Assessment
- 5x programming assignments, each with a specific weighting and contributing to an assignment mark out of 100
- final exam, contributing to an exam mark out of 100
- 1x bonus programming assignment, worth up to 5 (unconditionally-weighted) course marks

Your overall mark is the harmonic mean of your assignment and exam mark, plus however many marks you got for the bonus assignment. This means that you need to be consistent: if you aced the assignments but only scored a 65 in the exam, your final mark will come out to 78 before bonuses, which is probably lower than you’d otherwise expect compared to the arithmetic mean used by most other courses.
Assumed Knowledge
The only prerequisite is COMP2511. All of the assignments are written in Java, and some OOP design patterns (notably, the visitor pattern) are used.
Comments
This is a course primarily focused on the frontend components of a compiler, i.e. the phases from reading in a source file to producing the first iteration of executable code for the program. If you’re going into it to learn about things like compiler optimisations, then you might want to reconsider. You’ll spend most of your time learning about parsing programs and extracting meaning from them, both theoretically (via some automata and language theory) and practically (via scanner generators and things of that sort). You cover the process of how a program is turned into an abstract syntax tree, and then how the AST is used in order to check that it is semantically correct and then to finally generate executable code for that program. There are components of compilers past this point, but like I said, they aren’t within the scope of this course (or any other undergraduate course at UNSW anymore, it seems).

The heart of this course is the set of 5 assignments, with (almost) each one following on from the last by getting you to build a phase of a compiler for a simple variant of C. This is all done in Java, so you need to be confident with extending a given Java codebase, although specific OOP knowledge isn’t really needed outside of the basics and being vaguely familiar with how the visitor pattern works. You should also be comfortable dealing with a codebase that is a bit of a mess design-wise, as the starter code is quite questionable in that regard. A considerable amount of the lecture time is dedicated to talking about these assignments too, so in addition to the per-assignment FAQs and other documentation, you’ve got everything you need really, and they shouldn’t be too rough. Having imperfect solutions to the previous parts won’t hamper you too much, since compiled reference solution files are given so that the supporting code can at least work for you in subsequent assignments. However, if you do want to try and fix your code beforehand, Jingling always has assignment marks out within a few hours of submission, which is really quite an impressive logistical feat, and also very good for the students.
As an aside: this course pairs quite well with COMP4141 for the first few weeks. Just be careful of the workload later on in the term.
Contact Hours
- 2x 2 hour lectures
- 1x 1 hour tutorial
Difficulty
3/5
Lecture Recordings?
Yes, they were live over Teams.
Lecturer(s)
Scientia Prof. Jingling Xue
Notes / Materials Available
Decent; you get lecture slides and an almost weekly set of tutorial questions during the term, but we also ended up getting 4 past papers (albeit from about 20 years ago; still relevant, mind you) to help with exam revision.
Overall Rating
4/5
Textbook
“Compilers: Principles, Techniques and Tools” by Aho, Lam, Sethi and Ullman is recommended. Jingling often refers to it as the "purple dragon book" due to its cover.
Year & Trimester Of Completion
21T1
Your Mark / Grade
100 HD

Did you find this review helpful?

Australia Treasury

Help shape the future for all Australians

Want to make an impact to your local community and across Australia? Join Treasury, the Government’s lead economic advisor and be involved in developing policies and providing well informed, innovative and sound advice on key issues that impact Australians.

Find out more