Instructor
- Emil Sekerinski
- Office hours: Thursdays 2:30 - 3:20 and by appointment, ITB 215
Prerequisites
For COMPSCI 3TB3: COMPSCI 2C03, COMPSCI 2GA3, COMPSCI 2AC3 or 2FA3, and COMPSCI 3MI3For SFWRENG 4TB3: SFWRENG 2C03, SFWRENG 2FA3, SFWRENG 2GA3, and registration in Level IV or above of a Software Engineering
Calendar Description
Lexical analysis, syntax analysis, type checking; syntax-directed translation, attribute grammars; compiler structure; implications of computer architecture; mapping of programming language concepts; code generation and optimization.Midterm and Exam Dates
- Midterm Test: Wednesday, February 26, 1:30 - 2:20 (class time), T13 123 and T13 101; details will be announced on Avenue
- Final Exam: as announced on Mosaic
Format and Attendance
- The lectures and the tutorial introduce the course material through the course notes. Further study of the course notes is required, but reading in advance is not. Lectures and tutorials will have similar form.
- The labs present ungraded lab questions, discuss their solution, introduce the graded assignment questions, and present the solutions to the assignment questions of the previous week. The solutions to lab questions and assignments are only presented in the lab sessions; they are not posted.
- Attendance at the labs is required but not checked. Regular attendance to the lectures and labs is essential for the successful completion of the assignments, the midterm tests, and the final exam.
Material and Fees
- The course notes are freely available on the JupyterHub server; see Avenue for access. They can either be used remotely or can be downloaded. While you only need a web browser to access the course notes, is recommended that you install Jupyter and extensions on your computer for offline reading of the course notes. All software used in this course is freely available.
- You are asked to bring your laptop computer to the labs, midterm test, and final exam. Since the course notes are electronic and interactive, you can use your computer in the lectures and labs, but for the purpose of this course only. You must use your computer such that it is not distractive to those around you.
Learning Objectives
- Compilers convert programs in "high-level" languages to executable code. This course introduces the concepts of compilation and illustrates those by a compiler for a small Pascal-like language for a RISC processor. However, this course is not just about writing compilers!
- Students will learn to use parsing, analysis, and generation techniques for compilation and other syntax-directed processing (e.g. for query languages, mark-up languages, and protocols).
- Students will see the topics of other courses connected, in particular, architecture, programming languages, formal languages, and operating systems.
- Students will understand why programming languages are defined in the ways they are and be better prepared for new languages.
- Students will appreciate efficiency issues in programming languages by understanding the memory layout of data types (e.g. arrays, objects) and compilation of control structures (e.g. short circuit evaluation, recursion), which leads to a better programming style.
- Students will learn how compilation techniques (e.g. byte code, just-in-time, garbage collection) affect the suitability of programming languages for specific applications.
- Students will learn about optimization techniques and the impact of processor architectures, which how helps in using compilers more effectively.
- Students will be made aware of compiler construction tools (e.g. scanner and parser generators) and will be able to judge if and when to use them.
Topics
- Language and Syntax
- Regular Languages
- Analysis of Context-free Languages
- Syntax-Directed Translation
- The Construction of a Parser
- A Stack Architecture as Target
- A RISC Architecture as Target
- Further Data Types
- Concurrency and Parallelism
- Garbage Collection
- Generalized Parsing
Assessment
- Midterm Test and Final Exam are worth 70%: if the grade of the midterm test is higher than that of the final exam, the midterm test is worth 22% and the final exam is worth 48%. If the grade of the midterm test is lower than that of the final exam, the final exam is worth 70%. That is, taking the midterm test can only improve your final grade, not lower it.
- Assignments are worth 30%: there are 12 weekly assignments; each is introduced in the lab session for which you are registered. Each assignment is worth 3%; the marks are summed up and capped at 30%. That is, if you don't do perfectly on some assignments, you can stil get the full 30% of the assignments. If you MSAF an assignment, you get a 3-day extension. Collaboration on assignments is not allowed unless expliclity stated. Late submissions are not accepted.
- Tests: You must take the final exam. If you do not take the midterm test, the weight will be shifted to the final exam. The tests include programming questions with Jupyter. You need to bring a laptop computer that runs a web browser to the tests.
- The assignments, the midterm test, and the final exam are to be submitted on the JupyterHub server.
Academic Integrity
You are expected to exhibit honesty and use ethical behaviour in all aspects of the learning process. Academic credentials you earn are rooted in principles of honesty and academic integrity. It is your responsibility to understand what constitutes academic dishonesty.
Academic dishonesty is to knowingly act or fail to act in a way that results or could result in unearned academic credit or advantage. This behaviour can result in serious consequences, e.g. the grade of zero on an assignment, loss of credit with a notation on the transcript (notation reads: “Grade of F assigned for academic dishonesty”), and/or suspension or expulsion from the university. For information on the various types of academic dishonesty please refer to the Academic Integrity Policy
The following illustrates only three forms of academic dishonesty:
- Plagiarism, e.g. the submission of work that is not one’s own or for which other credit has been obtained.
- Improper collaboration in group work.
- Copying or using unauthorized aids in tests and examinations.