Instructor
Steve Zdancewic    office hours: Wednesdays 2:00-3:00 pm (and by appointment) Levine 511
Teaching Assistants
Calvin Beck
    office hours: Mondays 15:30-16:30 Levine 5th floor bump space
Paul He
    office hours: Tuesdays 9:30-10:30 am Levine 5th floor bump space
Nick Rioux
    office hours: Mondays 13:00-14:00 GRW 5th floor bump space ("Levine North")
Course information:
  time: TR 10:30am - noon  room: Towne 313
  piazza: cis341
  email: cis341@seas.upenn.edu
Prerequisites: CIS 121 and CIS 240
Topics:
- Lexing/Parsing
- Code generation
- Semantic analysis
- Optimization
- Run-time support
Reading and References
The following books contain useful course material, and much of the lecture content is derived from them (and other sources).
- Compilers (2nd edition) by Aho, Lam, Sethi, and Ullman
- Advanced Compiler Design and Implementation by Muchnick
- Modern Compiler Implementation in ML by Appel
- llvm.org
- Real World OCaml
- OCaml Programming Style Guide
- The Caml Web Site, particularly the documentation and users' manual and the standard libraries
- OCaml.org
- Developing Applications with Objective Caml by Emmanuel Chailloux, Pascal Manoury and Bruno Pagano
- Introduction to Objective Caml by Jason Hickey
Projects: Building a Compiler
There are several homework projects. Homework 1 is an individual assignment. The rest of the projects are pair-programming projects -- students are strongly encouraged to work in pairs, but may ask permission to work alone on them.
CIS 341 Toolchain - instructions for getting access to the tools you need to complete course assignments.
- Homework 1: Hellocaml
Due: Wednesday, January 29th at 11:59pm - Homework 2: X86lite
Due: Wednesday, February 12th at 11:59pm - Homework 3: Compiling LLVMlite
Due: Wednesday, March 4th at 11:59pm - Homework 4: Compiling Oat v.1
Due: Monday, March 30th at 11:59pm - Homework 5: Full Oat
Due:Friday, April 17 at 11:59pm - Homework 6: Dataflow Analysis and Register Allocation
Due: Wednesday, April 29 at 11:59pm
Grading Criteria
- 12% Midterm - Date: Thursday, March 5 in class
- Midterm 2020 and Solutions 2020
- Midterm 2018 and Solutions 2018
- Midterm 2017 and Solutions 2017
- Midterm 2015 and Solutions 2015
- 18% Final exam - Date: May 4, 2020.
Final Exam 2020 and tcpoly.ml (supplementary code)Details about the CIS341 final exam
- START TIME: Monday, May 4th at noon (East Coast TIme)
- END TIME: Friday, May 8th at midnight (East Coast Time)
- The exam will be posted to the course web pages and announced on Piazza.
- Submit your exam via GradeScope (link to be provided)
- The exam is intended to take (under) 2 hours, but there is no official time limit.
- The exam covers material from Lecture 15 to the end of the semester.
- The exam will be an editable PDF document.
Different PDF viewers provide different editing capabilities. Chrome's embedded PDF viewer seems to work well. On OS X, Preview is a good choice. On Windows, Adobe Reader or Adobe Acrobat should work.
- 70% Course projects
Lecture Slides and Notes
Recorded Zoom sessions starting from Lecture 15 (3/24/20) are available at Penn's PanOpto Site .
Some of the slides in these lectures have been adapted (with permission) from course materials by Andrew Myers at Cornell University and Greg Morrisett at Harvard University.
Course Policies
General Project Guidelines
- Groups:
Teams for group projects will consist of two students. - Difficulty:
The course projects are challenging and time consuming. They may require significant effort to understand the implementation details and concepts:Start Early! - Late Projects:
All projects are due at 11:59pm on the due date.- Projects submitted late, but within 24 hours of the deadline are subject to a 10 point penalty.
- Projects submitted late, but between 24 and 48 hours of the deadline are subject to a 20 point penalty.
- If, for some reason, you have an extension of less than 48 hours on the homework, the extension only overrides the associated late penalty -- it does not extend the late period!
- Regrade Policy:
Regrade requests should be sent to the TA. Only reasonable requests will be considered. The entire project or exam will be regraded. Note that this means that the score on a regraded project might decrease.
Submission Policy
- Projects that do not compile will get no credit.
- Projects that compile will receive partial credit according to the grading guidelines provided in the project description.
Academic Integrity
This course will abide by the University's Code of Academic Integrity. In particular, for individual projects and group projects, the following guidelines should be followed:- For individual projects, you must type in and edit
your own code, documentation, and any other materials submitted
for grading.
- Copying someone else's file is not allowed.
- Allowing someone else to copy a file of yours, either explicitly or implicitly by leaving your code unprotected, is not allowed.
- Editing each other's files is not allowed
- Regarding the ethics of what you may or may not discuss with
others:
- "High level" discussions are fine.
For example, discussions about the problem statement. - "Low level" discussions are fine.
For example, discussions about OCaml syntax or using omake, understanding compiler error messages, understanding the mechanics of the tools and libraries used for the projects. - "Mid level" discussions require
discretion. In this CIS course, discussions at this
level must be limited. Unless explicitly stated
otherwise, you may not collaborate significantly with
classmates (except group project members) at this level.
If you have minor discussions with others at this level or get
help from outside resources (tutors, web sites, etc), you must
cite in the readme of the submitted projects the names of the
people or websites who helped you and how they did. For
example:
Name: Chris Brown Email: ***@seas.upenn.edu I received tips from Jo Johnson on the i/o and example.com/mem.htm on memory ...
- "High level" discussions are fine.
- If there is any doubt about the use of external sources or collaboration, please ask for clarification by the course staff.
Although we encourage you to use version control software (e.g. git) for the course projects, please do not distribute the solutions.