Course Information

Course personnel:

 NameOfficePhoneEmailOffice Hours
InstructorKoushik Sen735 Soda510-642-2420ksen at   Tue 2-3PM

T.A.Caroline Lemieux347 Soda
N/Aclemieux@berkeley.eduTh 3-4PM
November 14: 4-5pm (subbed by Alex)
T.A.Rohan Padhye411 Soda

N/Arohanpadhye@berkeley.eduWed 2-3PM
T.A.Alex Yeo347 Soda
N/Aalexsyeo@berkeley.eduFriday 3-4PM
November 15: subbed by Caroline

Please attach prefix [cs164] to the title of emails.

Time and Place:

Lectures1Soda Hall 306TuTh 12:30P - 2PProf. Koushik Sen
Discussion Sections101Etcheverry 3119Mon 3P-4PCaroline Lemieux
102Evans 70Mon 4P-5PAlex Yeo
103Dwinelle 243Tue 10A-11ARohan Padhye

The TAs' discussion notes are available here.

Course description:

CS 164 is designed to acquaint students with the design and implementation of high-level programming languages. The course consists of a theoretical component, which stresses general underlying concepts, and a practical component, which consists of a significant course project. Students are expected to write the project in Java.

Course prerequisites:

CS 61A, CS 61B, and CS 61C or equivalent. Also required is the ability to program in Java on a UNIX system.

Tentative Syllabus & Schedule of Assignments


RecommendedA. Aho, R. Sethi, and J. D. Ullman, "Compilers: Principles, Techniques, and Tools", 1st edition, Addison-Wesley, 1986. You can also use the second edition.
RecommendedJFLex, Java Cup.
Andrew Appel, "Modern Compiler Implementation in Java". It is optional but helpful reading.

Copies of the lecture notes will also be made available on the course home page. 

Another book you might find useful is "Unix in a Nutshell (System V Edition)" by Gilly, published by O'Reilly & Associates. As its name suggests, the book is a short guide to working on a Unix system, including descriptions of common Unix commands and utilities. 

Written Assignments:

Most weeks there will be a written assignment covering material presented in lecture and the readings. The written assignments are to be completed individually. The purpose of the assignments is to give you practice with the theoretical material of the course. Spending time on the written assignments pays off on the exams. 

Written assignments are due by 12:40 p.m. on the date in the course schedule. Write your name, email address, and section on your assignment. Assignments must be submitted via

Please do not bring assignments to staff offices.


The course project consists of three projects. Taken together, the three projects form a complete implementation of a variant of Python.

Start the programming assignments early! Completing the course project is a large, complex, and rewarding task, which is made much easier by giving adequate forethought to design. The course schedule allows ample time to complete the assignments, so take advantage of it. Programs will be evaluated for correctness, organization, and documentation.

Documentation and structuring should be incorporated into programs from the beginning. Neither the instructors, teaching assistants, nor readers will help with incomprehensible programs.

Programming assignments should be done in teams of two. Teamwork imposes burdens of communication and coordination, but has the benefits of more thoughtful designs and cleaner programs. Team programming is also the norm in the professional world.

Students on a team are expected to participate equally in the effort and to be thoroughly familiar with all aspects of the joint work. Both members bear full responsibility for the completion of assignments. Partners turn in one solution for each programming assignment; each member receives the same grade for the assignment. If a partnership is not going well, the teaching assistants will help to negotiate new partnerships. Teams may not be dissolved in the middle of an assignment.

Programming assignments are due at 11:59 p.m. on the date in the course schedule. Programming assignments will be turned in electronically. The exact method will be announced with the first assignment.

Late Policy:

Each student gets an automatic extension of 100 hours. You can use the extension on any programming assignment(s) during the semester (in increments that are rounded up to the nearest integer). For instance, you can hand in one assignment 100 hours late, or each of three assignments 33 hours late. For group project assignments, the slip time will be deducted from each team member's remaining slip time. When you hand in a late assignment, you must identify in the README file the following: (i) how late this assignment is, and (ii) how much of the total slip time you have left. No assignment will be accepted more then 100 hours late. After you have used up your slip time, any assignment handed in late will be marked off 1% per hour. This policy does not apply to the written assignments.

There is a 1% penalty for each hour, or partial hour, that a programming assignment is late. That is if you turn in the programming assignment at 8am the next day (i.e. 8 hours late) your grade for that assignment will be multiplied by a factor of 0.92. 

Late written assignments will receive no credit. 


There will be two midterm examinations and a final. 

The first midterm will be held in class on  Tuesday, October 1st, and the second midterm will be held in class on Thursday, October 31st

The final exam is scheduled for Friday, December 20th, 8am-11am.

There will be no early or make-up exams. Please plan accordingly!

Regrade Policy:

Regrade requests will only be accepted for programming assignments and exams. In either case, all regrade requests must be received within one week upon receiving your score. For exams, we will only consider regrades if we made a mistake in the grading of your exam. Note that we reserve the right to regrade the entire exam. For programming assignments, we will only consider regrades if we made a mistake in the grading of your project or if there was a small bug in your project that caused you to lose at least 10 points. A small bug is one that can be fixed by changing very few lines of code without affecting the design or the algorithm in a significant way. All such requests must be made to your TA (not to the readers). If we accept the regrade request we will re-run the autograder and will give you 50% of the score difference.

Discussion Sections:

Students are expected to attend discussion sections. Relevant material, especially the details of the programming assignments and software tools, will be covered only in discussion sections.


It is impossible to pass the course without doing the programming assignments. The relative weight of the components of your grade will be approximately:

Piazza participation3%
Written assignments5%
Course project I14%
Course project II14%
Course project III14%

Midterm I12.5%
Midterm II12.5%

It is expected that all students understand University policies on academic honesty. Cheating on assignments or exams is very serious and will not be tolerated. In this course, we will use a variation of the standard policy. In this class, it is permissible to talk to other students about assignments, to discuss particular solutions, and even to receive partial solutions (including code) from others. However, all assistance and cooperation must be cited in the assignment write-up. If you receive any assistance from anyone other than course staff or your partner on an assignment, you must acknowledge in the write-up for that assignment who gave assistance and what assistance was given. Grading will take into account how much help a student received from others (the more help, the lower the grade). Failure to acknowledge sources is plagiarism and will be treated as a serious breach of academic honesty. No assistance may be given or received on exams. 

You should know that fairly sophisticated plagiarism detection software will be used on the programming assignments.


Handouts will be available on-line on the class home page. 


The material presented in class will correspond roughly but not exactly to the material covered in the readings. The assigned readings for the latter part of the course are tentative.

Home Page and Forum:

The class home page for this semester is All course handouts, answers to frequently asked questions, lecture notes, and updates on assignments will be posted on the home page. The class forum is