CS 440, Spring 2019: Programming Languages and Translators http://cs.iit.edu/~cs440

Class Meetings

Staff Information (Last updated Jan 17 14:54)

Role Person Office Hours
Instr http://cs.iit.edu/~sasaki
TA Tue / Thu, 4:00 - 5:00 pm, SB 004, x7-5149

Academic Honesty

Students are responsible for maintaining the highest level of academic integrity as discussed in the IIT Code of Academic Honesty. The normal penalty for a violation of this policy for a non-final exam is a score of zero, with no Test Score Replacement (see below); for the Final Exam, the penalty is a final grade of E. In either case, Academic Honesty and the student's advisor and/or department (or other relevant administrators) will be notified. Note that the College of Science specifically prohibits cell phones and other electronic devices during exams.

Course Goal

To understand scanning, parsing, and and basic compiler design and creation. To study and compare features found in various different modern languages, with a view toward understanding the trade-offs needed to create a language.

Disability Policy

Students with disabilities requiring academic accommodations should contact the Center for Disability Resources (disabilities@iit.edu, 312.567.5744). Please do this well in advance of needing an accommodation.

Blackboard, Piazza, Office Hours

Blackboard will be used to submit work and to list grades, but links to lecture notes, homeworks, etc. will be on this page. We'll use Piazza for discussions outside class -- feel free to post questions or answers. The TAs and instructor will hold regular office hours. You can send email to them, too.


You're expected to attend or stream lectures and to keep up with them. Attendance will be taken intermittently (for internet students, we look at access dates on Blackboard). It can be used at the end of the semester as a tie-breaker for the final grade. The Handout / Reading column indicates lecture readings (possibly as links to files). Lectures may include in-class activities; these are generally not graded or reviewed, but can be. Solutions to activities (if posted) are appended to the notes.

Class Schedule (Last updated Mar 14 21:58)

The schedule below includes information on lectures, tests, and homeworks. Dates are added or changed when an entry is added or changed, so check the schedule often.

Date Type Event Handout / Reading Note
Mon 1/14 Info Spring Classes Begin
Mon 1/14 Lec 1 Haskell Lec_01_Haskell1.pdfv. Wed 1/16, 15:56
Wed 1/16 Lec 2 Haskell Lec_02_Haskell2.pdfv. Thu 1/17
Mon 1/21 Holiday Martin Luther King, Jr. Day - No Classes
Wed 1/23 Lec 3 Haskell Lec_03_Haskell3.pdfv. Tue 1/29
Fri 1/25 Post: HW 1 Basic Haskell HW_01.pdfv. Fri 1/25
Mon 1/28 Lec 4 Haskell Lec_04_Haskell4.pdfv. Fri 2/1
Wed 1/30 Holiday Class Cancelled (Weather)
Sat 2/2 Due: HW 1 Basic Haskell HW_01_soln.pdfSolution v. Wed 2/6
Sun 2/3 Post: HW 2 Haskell 2 HW_02.pdfv. Mon 2/4
Mon 2/4 Lec 5 Haskell Lec_05_Haskell5.pdfv. Mon 2/4
Wed 2/6 Lec 6 Regular Expr, FSM, Scanners Lec_06_RegExpr.pdfv. Thu 2/14
Sat 2/9 Due: HW 2 Haskell 2 HW_02_soln.pdfSolution v. Wed 2/20
Mon 2/11 Lec 7 Regular Expr, FSM, Scanners Lec_07_RE_FA.pdfv. Tue 2/12
Mon 2/11 Post: HW 3 Reg Expr and Finite Aut HW_03.pdfv. Thu 2/14
Wed 2/13 Lec 8 Regular Expr, FSM, Scanners Lec_08_Scan_Gram.pdfv. Wed 2/13
Sat 2/16 Due: HW 3 Reg Expr and Finite Aut HW_03_soln.pdfSolution v. Wed 2/20
Sun 2/17 Post: HW 4 Implementing Reg Expr HW04_packet.zipv. Sun 2/17
Mon 2/18 Lec 9 Grammars, Parse Trees, Productions Lec_09_Gram_Prod.pdfv. Mon 2/18
Wed 2/20 Lec 10 Recursive Descent Parsing Lec_10_RecDesc.pdfv. Wed 2/20
Mon 2/25 Exam X1 Material in Lec ≤ 6, HW ≤ 3 X1_study.txtX1_stats.txt
Wed 2/27 Lec 11 Recursive Descent Parsing Lec_11_RecDescEx.hsv. Mon 2/25
Sat 3/2 Due: HW 4 Implementing Reg Expr HW04_packet.zip
Mon 3/4 Lec 12 LL Table-Driven Parsing Lec_12_LL_Parsing.pdfv. Tue 3/5
Wed 3/6 Lec 13 LL Table-Driven Parsing Lec_13_LL_Parsing2.pdfv. Sun 3/10
Mon 3/11 Lec 14 LL Parsing; Bottom-Up Parsing Lec_14_LL_BU_Parsing.pdfv. Mon 3/11
Wed 3/13 Lec 15 LR Parsing Lec_15_LR_Parsing.pdfv. Thu 3/14
Mon 3/18 Holiday Spring Break (no classes)
Wed 3/20 Holiday Spring Break
Mon 3/25 Lec 16 LR Parsing
Wed 5/1 Info Last Class
Sun 5/5 Info Last Day to Request an Incomplete
Mon 5/6 Exam Final (Sometime this week) Comprehensive;
Time/Location To Be Announced


cover (Required) Learn You a Haskell for Great Good, by Miran Lipovača, © 2011, ISBN-13: 978-1-59327-283-8. There's a free online version and electronic and print versions. cover (Optional) Haskell (wikiBook) Online; printed, pdf, and e-book versions are available.
cover (Required) Algorithms for Compiler Design, by O.G. Kakde, © 2002, ISBN-13: 978-1-58450-100-8. To access the boook, log into the MyIIT portal, then sign in at Books 24x7, then access the Kakde book. We'll concentrate on Chapters 1 - 7. cover (Optional, Reference) Real World Haskell, by Bryan O'Sullivan, Don Stewart, and John Goerzen, © 2008, ISBN-13: 978-0-59651-498-3, O'Reilly press. There's a free online version and a print version.

Homework Policies


Links to assignment handouts and information on due dates are included in the schedule. The number and timing of assignments may change as time goes on. If posted, solutions are appended to the assignment handout. Solutions to programming problems aren't typically posted.

Final Project: There will be an individual (not group) final project. Stay tuned for more information.

Work With Others; How to Submit

You're encouraged to work in groups of three or fewer on homeworks. Submit your answers from just one person in your group. Be sure to include the names and A-id numbers of all the group members at the top of the submission. Don't submit as a group; each person should submit separately. Submit using the Assignment folder on Blackboard; a pdf is best. (A scan of a handwritten solution is okay.) You can submit multiple times, but we'll grade only the last submission, so submit the entire homework every time. Written work can also be turned in class. If the CS office is open, you can also turn in work there. (In that case, please get it time-stamped.)

Unless otherwise specified, work is due at 11:59 pm on the specified day. (Recommendation: Don't wait until 11:58 to submit -- Blackboard can sense fear and will act accordingly. :-)

Late or Malformed Work

Work may be handed in up to two days late with a 5% penalty for one day late and a 10% penalty for two days late. (Saturday and Sunday count as days.) After this, work can be discussed but it earns a score of 0. You can't turn in a bunch of things at the end of the semester and get them graded.

It is your responsibility to make sure that you submit what you intend to submit and that what you submit is readable. If you submit a bad or unreadable assignment, etc., you may earn a penalty anywhere from a point off to no credit at all.

For programs, we'll specify some standard testing environment and grade relative to that. Stay tuned for further information.


If you have an emergency or are ill, it may be possible to excuse you from an assignment or to get you an extension, but contact the instructor (or have a friend or family member contact the instructor) as soon as you can. Please don't wait. Overly delayed requests may be denied. You can't get a retroactive extension on work you've already turned in or once the semester ends.

Homeworks and Activities are Important!

It's important to do the homeworks and any lecture activities because they will help you prepare for the tests. If solutions to written questions are posted, they are appended to the assignment or lecture handout. Solutions to programming problems aren't typically posted.

Test Policies


The dates of tests and the materials covered by the tests are listed in the schedule. They're pretty firm, but it's possible they might be tweaked, so keep an eye out. The final exam will be comprehensive, with an emphasis on later material. The final exam date and location is set by the registrar. (Details will be announced near the end of the semester.) If you need to take a test at a nonstandard time, contact the instructor well in advance for permission.

Tests for Internet Sections: If you're in the regular Internet section, then if you want to, you can take tests on main campus with the live class. (No need for advance permission; just show up.) If you're outside the Chicago area or you want to take your test off-campus, contact the Office of Digital Learning well in advance to arrange for a proctor. If you need to take a test at a nonstandard time, in addition to contacting the instructor, contact the Office of Digital Learning, again, well in advance of the test date. If you're in the India Internet student, coordinate with IIT India for test times and locations.

Tests: One Page of Notes Allowed

Tests are closed-book but you can bring one 8.5" × 11" or A4 page of notes, both sides. It can be hand-written, printed, etc. Bringing more than one page breaches academic honestly. Don't use the notes as a substitute for learning the material. The one-page limit also applies to the final exam even though the exam is comprehensive. Accommodation aids specified by the disability office are allowed; College of Science policy specifically prohibits cell phones and other electronic devices during exams.

Makeup Tests

If you're going to be out of town the day of a test, arrange for a change in test times well in advance. If, during a test, you feel too ill to finish it, stop and come up and talk to the instructor so we can work on rescheduling it — you can't retake a test once you turn one in. It might be possible to get a makeup test if you miss a test due to illness or other emergency, but contact the instructor as soon as possible. Overly delayed requests may be denied; requests made after the end of the semester will be denied.

Test Score Replacement

If you earn a bad score on the Midterm Exam, the Final Exam will give you a chance to recover. When calculating end-of-semester scores, if your Final Exam score is greater than your earlier exam score, it will be used instead of the earlier score. (The replacement gets done when calculating end-of-semester scores; the exam score shown on Blackboard doesn't change.) The Final Exam will include a review of earlier material that (on average) the class did badly on.

Test and Homework Regrades

For test regrades, see the instructor. For homework regrades, see the TA who graded it before seeing the instructor. For the Final Exam, requests must be made within two weeks after the exam score is announced. For Homeworks and earlier exam(s), requests must be made within a week of receiving a grade.

You can't just get a whole long problem or homework or test regraded; you must specify particular errors and include an explanation for each request. Don't just say "I think it's worth more points". Point out specific errors, such as adding up your points wrong or show that we missed something. Note that "needing" more points is absolutely not a justification.

Final Grade Policies

Final Grade Calculation

End-of-Semester Score: (Tentative): 10% Homeworks (average), 10% Final Project, 22% each Exams 1 and 2, 36% Final Exam. (All scores are scaled to 100.)

Final Grade Cutoffs: A: 90-100; B: 80-89; C: 70-79; D: 60-69; E: < 60. You can also earn an E by having an average Homework score < 30% or Final Exam score < 40. Grade cutoffs are only rarely changed, and never by increasing them. (Note: the 30% Homework rule isn't aimed toward causing people to fail, it's more to warn people: If you have such a score, you're at least close to failing.)

Final Grade Describes the Quality of Your Work

The most popular question I get after final grades is "Can't you just give me the higher grade?" First off, I don't "give" grades, you "earn" grades. My job is to discern your grade by looking at your work and figuring out its level of quality. In the large majority of cases, the answer to "What grade is this worth?" is so obvious that there's no doubt involved. If the answer is not obvious, then first, if you're two points short on the Final Exam, I'll give you the benefit of the doubt and mark down the higher grade. (That's two exam points, not two EOS points.) If you're five points short, expect the lower grade. Otherwise, I look for every reason I can find to push you up to the next higher grade, such as a Final Exam score that's much better than average. If I can't find any, I figure you've earned the lower grade.

Final Grade Curving

In general, I like the class average Final Grade to be a high C or low B.If a curve is needed, it's done by adding a constant > 0 to everyone's final score. Individual exams etc. don't get curved. I don't know what curve there will be until the end of the semester. If there's a midterm grade and it's curved, that curve implies nothing about any final grade curve.

Doing Extra Work to Raise Your Grade

Another very popular question is "Can I do extra work to raise my grade?". (Variations include "Can I retake an exam?" and "Can I turn in this (horrendously late) homework?".) Briefly, no. To be fair, all students must have the same opportunities to do the coursework. Giving one student a chance that others don't get would cheat the other students.


You can't get an incomplete after taking the final exam. First, the registrar's deadline for requesting an incomplete occurs before final exam week. Second, once you take the final exam, they consider your semester's work to be complete.

Your Final Grade Causes Problems

Since your final grade reflects the quality of your work, it can unfortunately happen that you come to every class, ask questions, work very hard, and still earn a bad final grade. In any case, I know it can happen that earning a bad final grade puts you in a very painful or even disastrous position. Personally, I feel bad for you, but professionally, I can't use your situation to affect your final grade. The final grade can only depend on the quality of your work, otherwise we'd be cheating the other students.

Posted Thu Mar 14, 2019; Copyright © 2019; James Sasaki, Illinois Institute of Technology. xhtml css