CPSC 433: Compilers (Spring 2009)

Lecture 10:10AM - 11:05AM (period 3), Mon/Wed/Fri, Lansing 301 (Class Schedule)
Lab 1:30PM - 2:55PM, Thu, Lansing 311 (Lab Schedule)
Web: http://math.hws.edu/mcorliss/spring09/cs433/index.html

Announcements

  • [May 4] - The review for the final exam is on Thursday (5/7) at 2PM. Make sure you look over your notes and the homework before coming to it.

  • [Mar 31] - The review for the second exam is in class tomorrow (4/1). Make sure you look over your notes and the homework before coming to class.

  • [Feb 18] - The review for the first exam is on Thursday at 5:30PM in Lansing 301. If you can't make the review then please schedule another time with me to meet to talk about the exam. Otherwise, see you there.

  • [Jan 19] - My office hours are Mon/Wed 3PM-4PM, Thu 10AM-noon, and Fri 9AM-10AM. 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. Also, 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 the class schedule, lab schedule, and this page regularly.

Staff

Instructor: Marc Corliss (corliss at hws dot edu)
                   Office hours: Mon/Wed 3PM-4PM, Thu 10AM-noon, Fri 9AM-10AM.

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, 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. Homeworks 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 lab may be due at the start of normal class period rather than a lab period).

Course Work

Projects. This course will be project based. There will be 5 or 6 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 project by the end of that week or they will be deducted some points off of their total grade for that particular project. In general each checkpoint is worth 10% of the total grade for that particular project. Note: the checkpoints are not intended to penalize students, but rather to ensure that students are starting early on each project and working regularly on them.

Late projects will be accepted. Each student has three "grace" days to use to hand in late projects with no additional loss in points. Note: they cannot be used for checkpoints, only for the final project submission. These "grace" days are per semester not per project, so if a student uses all three for one project, they will have no more "grace" days for any subsequent projects. Weekends count as "grace days", so for example, if a project 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 grade per day late. If a student turns multiple projects in late and runs out of "grace" days, then the "grace" days will be used on the project (or projects) with the highest weight.

Homeworks. In addition to the project there will be regular homeworks 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 homeworks are not accepted, however, the lowest homework 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 first is tentatively scheduled for Friday, February 20th. The second is tentatively scheduled for Friday, 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, 10:10-11:05, Lansing 301) and labs (Th, 1:30-2:55, Lansing 311). 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: 50% (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.: 5%

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

Hobart and William Smith Colleges encourages students to seek the academic collaboration and resources that will enable them to demonstrate their best work. Students who would like to enhance their study skills, writing skills, or have other academic inquiries should contact the CTL (Center for Teaching and Learning). You may visit the CTL web site to learn more about the services and programs that are available: http://www.hws.edu/academics/ctl/index.aspx.

If you are a student with a disability for which you need or may need accommodations, you should self-identify and register for disability related services with the Coordinator of Disability Services at the Center for Teaching and Learning (CTL). You will then be required to provide for review documentation of your disability to that office. 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.

If you have a question about this process or Disability services at HWS, please contact David Silver, Coordinator of Disability Services, at email address silver AT hws DOT edu or extension 3351.

Resources