CS536-S23 Intro to PLs and Compilers


How credit hours are met by the Course

Traditional Carnegie Definition - Two 75-minute faculty-taught classroom lectures and a minimum of two hours of out-of-class student work each week over approximately 15 weeks

Learning Outcomes

Scanners: Defining DFAs and NFAs, epsilon transitions, converting DFAs to NFAs, regular expressions, Kleen star, converting regular expressions to NFA, and using JLex.

Grammars and parsing: Limitations of regular expressions and context-free grammars, Chomsky hierarchy, grammar productions, derivation rules and ambiguity, abstract syntax tree (AST), syntax directed translation (SDT), parser generators, using JCup, bottom-up parsing vs top-down parsing, Chomsky Normal Form and CYK algorithm, grammar classes, LL(1), LALR(1), refactoring grammars, building parsing tables, FIRST and FOLLOW sets, LR parsing

Name-Type Analysis: Name analysis and type analysis, scopes, nested scopes, symbol tables, static vs dynamic scopes, variable shadowing, forward references, type systems, type coercion, duck typing, strong vs weak typing, dependent types, resource types.

Runtime Environments: Memory abstractions, stack layout, activation records, dynamic memory allocation and heap, frame and stack pointers, function calls, parameter passing styles: by-value, by-reference, by-name, by-value-result, accessing local and global variables, dynamic vs static scope, access links and displays, deep vs shallow access.

Code generation and optimization: Machine code generation from AST, Intermediate representation (IR), three address code (3AC), LLVM, backend for MIPS, code generation for functions and calls, control flow, peephole optimizations, loop invariant code motion, loop unrolling, loop fusion, intraprocedural analysis, dominators and post-dominators, SSA form, dataflow analysis.

Evaluation

There will be a large semester-long programming project (broken down into 6 separate assignments) involving writing a compiler for a very simple language. The compiler will be written in Java, using a variety of tools, including Make, JLex, JavaCUP, and (tentatively) Spim. All students will work alone on the first programming assignment. Computer Sciences and Computer Engineering graduate students will work alone on the remaining assignments; undergraduates, special students, and graduate students from other departments have the option of working in pairs.

Your performance in the course will be evaluated based on the following:

Academic misconduct of any kind will not be tolerated.

Scores and feedback for individual assignments will be reported through learn@uw

Exams

There will be one midterm exam and one final exam totalling 50% of your grade.

  • Midterm (25%): in class

  • Final (25%): in person

Exams are closed-book and will consist of both multiple-choice and written questions. The final will be cumulative but with the majority of the exam on the topics covered since the midterm. You are responsible for material covered in the lectures, readings, and assignments. Note that some details may be covered in the readings but not in the lecture and vice versa.

Conflicts: Any date conflicts must be brought to the instructor's attention during the first week of class.

You MUST bring your student ID to identify yourself.

Assignments

There will be six programming assignments worth a total of 40% of your final grade. Accounts are provided on the CS lab computers for you to do your programming work. See the CS Computer Labs page for more information.

Collaboration is allowed in pairs if you choose, for students who are not CS or ECE graduate students, and only for programming assignments 2-6. All other assignments must be completed individually with no collaboration. You may discuss high-level ideas with your classmates and the instructor/TA.

Ask any questions on Piazza. Before posting a question, please search to ensure your question hasn't already been asked and answered.

Regrading requests must be submitted within *5* days of the release of the grade for a specific programming assignment.

Late Policy Programming assignments have a little leeway:

  • 0-24 hours late: 10% of the total points for the assignment will be deducted.

  • 24-48 hours late: 20% of the total points for the assignment will be deducted.

  • more than 48 hours late: The assignment will not be accepted. This rule is strict and you cannot use free late days to override it!

You are given five (5) free late days that are automatically applied to reduce or eliminate a late deduction (still, you cannot submit any programming assignment more than 48 hours after the deadline). However, you can only use at most 2 free late days per assignment. Consider them as insurance to be used in emergencies, such as when you may be unable to complete an assignment on time due to illness.