CPSC 433: Compilers (Spring 2011)

Lecture 1:55PM - 2:50PM (period 3), Mon/Wed/Fri, Lansing 301 (Class Schedule)
Lab 1:30PM - 2:55PM, Tue, Lansing 310 (Lab Schedule)
Web: http://math.hws.edu/mcorliss/spring09/cs433/index.html

Announcements

  • [Mar 23] - Homework 6 will be due on Wednesday 3/30 rather than Monday 3/28 (due to the exam change).
  • [Mar 23] - Exam 2 has been rescheduled to Thursday, 3/31 at 6PM. The exam will be taken in our normal classroom.
  • [Mar 21] - The project 3 deadline has been extended to Thursday, 3/24 at 1:30PM. The homework 5 deadline has been extended to the start of class on Wednesday, 3/23.
  • [Jan 19] - My office hours are Mon/Wed 10-11, Tue 10-12, and Thu 2-3. Please stop by with any and all questions or comments. If you can't make my office hours then send me an email and we can coordinate a meeting at another time. In addition, feel free to stop by my office unannounced at any time and if I'm available I will meet with you.

  • [Jan 19] - Make sure you view the class schedule, lab schedule, and this page regularly.

Staff

Instructor: Marc Corliss (corliss at hws dot edu)
                   Office hours: Mon/Wed 10AM-11AM, Tue 10AM-12PM, and Thu 2PM-3PM.

Course Summary

This course explores the design and construction of modern compilers (the software tool for translating high-level programs into a machine-level representation). In studying compilation, students will see deeply how modern programming languages such as Java are implemented. Students will also see in modern compilers the application of many of the concepts they studied in other areas of computer science such as computational theory, data structures, and algorithms. Finally, students will be exposed to several software engineering techniques, which make buiding a complex compiler tractable.

The course will focus primarily on compiling object-oriented programming languages, although it will also look briefly at compiling for languages from other programming paradigms. Major topics in compilation will be covered, including scanning, parsing, semantic analysis, code-generation, optimization, and garbage collection.

In addition to studying the design of compilers, students will build a working compiler for Bantam Java, a simple object-oriented programming language based on Java. This project is a substantial part of this course (both in terms of time and grade). It will give students practical experience in constructing a compiler and provide students with invaluable software engineering experience.

The prerequites for this course are CPSC 225 (intermediate programming) and CPSC 229 (foundations of computation). Students must have taken these two courses and received a grade of at least a C-. If that is not the case, the student should meet with the instructor before enrolling for the course.

Textbook

"Engineering a Compiler" by Cooper and Torczon

Schedule

The tentative class schedule and lab schedule are online. The class schedule shows the planned readings, homework assignments, and exams. It is split into several topics that usually make up one chapter of the textbook (note: some of the sections of the book will be read in a different order). The readings listed for each class day should be done prior to the start of that class. Homework assignments should be handed in at or before the start of each class in which they are due. Exams and vacation days are also indicated on the schedule.

The lab schedule shows the planned projects. Project assignments will be linked off of this page once they are assigned. They must be completed at or before the start of the lab period in which they are due. Note: occasionally a project assignment may be due at the start of normal class period rather than a lab period. In addition, the midterm exams will be given during lab periods. In these weeks, the normal lab will held on the Monday or Wednesday class (see the class schedule for details).

Course Work

Projects. This course will be project based. There will be 5 to 7 substantial projects. The first project will be written in the programming language Bantam Java; a slimmed-down, Java-based language, for which students will eventually build a compiler. This first project will give students exposure to the Bantam Java programming language and give them experience with some aspects of compilation. The remaining projects will implement various components of a Bantam Java compiler such as a scanner, a parser, a semantic analyzer, and a code generator. These will be written in the Java programming language.

The projects will vary in difficulty and time to complete. In general, projects earlier in the semester will be smaller than projects later in the semester. Some projects will be due in a single week, while others will be due in two or three weeks. Project grades will be weighted based on the number of weeks that are given to complete the assignment (not counting any late days). A 1-week project will have weight 1, a 2-week project will have weight 2, and so forth. The total project grade will be computed by multiplying each project grade by its weight, summing them all up, and dividing by the total number of project weeks.

The projects will require a significant amount of time, so students should start early on them. As mentioned above, some projects will take several weeks to complete. In these cases, there will be checkpoints each week; students will be required to complete a certain portion of the assignment by the end of that week or they will be deducted some points off of their total grade for that particular assignment. In general each checkpoint is worth 5% of the total grade for that particular assignment. The code submitted for a checkpoint need not be perfect; during grading it will not be run but instead examined by eye. But all of the required code must be completed and there should be no glaring omissions or errors. Note: the checkpoints are not intended to penalize students, but rather to ensure that students are starting early on each project assignment and working regularly on them.

Late projects will be accepted. Each student has three "grace" days to use to hand in late project assignments with no additional loss in points. "Grace" days can not be used for checkpoints just for final project assignment submissions. These "grace" days are per semester not per assignment, so if a student uses all three for one assignment, they will have no more "grace" days for any subsequent project assignments. Weekends count as "grace days", so for example, if an assignment is due on Friday and is handed in on the following Monday, then all three "grace" days are used up. Once a student runs out of "grace" days, they will lose 10% off the total project assignment grade per day late. If a student turns multiple project assignments in late and runs out of "grace" days, then the "grace" days will be applied to the assignment (or assignments) with the highest weight. Although "grace" days can't be used for checkpoints, one checkpoint grade will be dropped during the course of the semester. The checkpoint in any particular project assignment that results in the largest loss of points in terms of the student's cumulative grade will be dropped (i.e., the points lossed from the checkpoint will not be deducted from the particular project assignment grade).

Homework. In addition to the projects there will be regular homework assignments that will help make sure students keep up with the in-class material and textbook reading. These will be weighted overall much lower than the projects (each will be worth roughly 1% of a student's total grade). Late homework assignments are not accepted, however, the lowest homework grade will be dropped.

Exams. There will be two midterm exams and a final exam. Each midterm exam will be in-class, written (no programming on the computer), and closed book/notes. The midterm exams will be held in the lab periods (on Tuesday, Lansing 301) rather than in the lecture period so that students will have more time to complete the exam. Either the prior or subsequent lecture period (on Monday or Wednesday) will be used for that week's lab (i.e., it will be held in Lansing 310). (See the class schedule for details). The first exam is tentatively scheduled for Tuesday, February 22nd. The second exam is tentatively scheduled for Tuesday, March 29th. The final exam will be cumulative, but will emphasize aspects of the material covered in the last third of the course. The final exam will be held on Tuesday, May 10th from 8:30AM to 11:30AM in Lansing 301. Making up exams will only be allowed for *compelling* circumstances, i.e., with documentation from an appropriate person (doctor, dean). Arrangements must be made in advance for non-emergencies.

Exams. There will be two midterm exams and a final exam. Each midterm exam will be in-class, written (no programming on the computer), and closed book/notes. The first is tentatively scheduled for Tuesday, February 22nd. The second is tentatively scheduled for Tuesday, April 3rd. The final will be cumulative, but will emphasize aspects of the material covered in the last third of the course. The final exam will be held on Saturday, May 9th from 1:30PM to 4:30PM in Lansing 301. Making up exams will only be allowed for *compelling* circumstances, i.e., with documentation from an appropriate person (doctor, dean). Arrangements must be made in advance for non-emergencies.

Attendance/Participation. To get full credit for participation, students should attend all lectures (MWF, 1:55-2:50, Lansing 301) and labs (Tu, 1:30-2:55, Lansing 310). Students can miss at most three combined lectures and labs (for any reason). If a student misses more than three classes (combined lectures and labs), they will lose 10% of their attendance/participation grade per day missed.

Grading

Projects: 45% (see text above for weight of individual projects)
Written assignments: 10% (roughly 1% each)
Midterm exams: 20% (10% each)
Final exam: 15%
Participation, attendance, etc.: 10%

Academic Integrity

The Principle of Academic Integrity (see the HWS Catalogue, p. 33) governs the work completed in this course. The following outlines specifically how this principle applies.

Exams. All exams are to be completed solely by the student whose name is on the paper. Unless otherwise specified, these are closed book/notes, which includes any materials not provided as part of the exam.

Homework. Homework assignments are to be completed solely by the student whose name is on the paper.

Projects. The projects are also to be completed solely by the student submitting the project for credit. Students may not work with other students, including discussing ideas, offering debugging help, or looking at their programs. Students may consult the book, their notes, any course materials provided in class or on the course website, and reference books found in the lab. Use of other materials (including websites) is not allowed. It is never acceptable to be in possession of another student's program, either hardcopy or electronic.

Each program submitted for credit will be checked by a plaigarism detector called MOSS (http://theory.stanford.edu/~aiken/moss/) to determine if it was copied. MOSS is highly accurate at detecting plagiarized software (changing a few variable names, comments, etc., will not help). In addition, any student that submits a suspicious project will have to explain their code to the instructor. If they are unable to effectively explain the code, then they will not receive credit for the assignment (and the case may be taken to the committee on standards).

Summary. The moral of the story is students should not cheat in this course. For each case of cheating, the student will receive a 0 on the assignment, and the case will be pursued with the HWS committee on standards. It is better to submit an incomplete solution rather than submit a plagiarized solution.

Center for Teaching and Learning

About the Center for Teaching and Learning (CTL): At Hobart and William Smith Colleges, we encourage students to seek the academic collaboration and resources that will enable them to do their best work. The CTL offers a variety of resources that can help students achieve academic success, including Teaching Fellows (for course content help in the departments of Anthropology/Sociology, Biology, Chemistry, Economics, Geoscience, Philosophy, Physics, Psychology, Spanish & Hispanic Studies), Writing Colleagues (for help on papers), Study Mentors (for help with study skills and time management), Group Study Tables (for content help in specific courses), and more.

The CTL resources most useful for this class include the Teaching Assistants (actually managed by the department not CTL) and Study Mentors.

For more information on these resources, visit the CTL webpage at http://www.hws.edu/academics/ctl/index.aspx, or visit the CTL Blackboard site.

Disability Accommodations: If you are a student with a disability for which you may need accommodations, you should self-identify and register for services with the Coordinator of Disability Services at the Center for Teaching and Learning (CTL), and provide documentation of your disability. Disability related accommodations and services generally will not be provided until the registration and documentation process is complete. The guidelines for documenting disabilities can be found at the following website: http://www.hws.edu/disabilities.

Please direct questions about this process or Disability Services at HWS to David Silver, Coordinator of Disability Services, at silver@hws.edu or x3351.

Resources