CS 421: Programming Languages and Compilers
Objectives
Students taking this course can expect to be able to:
  • Program in a functional programming language
  • Understand the evaluation of programs in a functional programming laguage
  • Write a type checker / type inferencer given a formal type system
  • Write a lexer, and a parser using recursive-descent parsing, or a parser-generator
  • Write a syntax-directed translator from abstract syntax to intermediate representations
  • Recognize and use major methods of specification of dynamic semantics
  • Write a interpreter based on a formal operational semantics of the language

Contacting the Course Staff
  • For email and Campuswire: please allow about 24 or so hours for a response, except on weekends (see below).
  • The staff do not work on the weekends. If you send or post something late Friday or over the weekend then you should not expect a reply before Monday.
  • Never ever EVER call any staff at home.

Submitting Assignments
This semseter, there are two kinds of assignments in this course: machine problems (MPs), and web assignments (WAs). MPs are submitted as text files, one for each problem, with the file usually named after the code being implemented. WAs are calculational exercises. Both are submitted in PrairieLearn. For each problem in an MP, you will be given in PrairieLearn an editor (VSCode), containing a window with a file for you to complete with the answer to the problem. It typically will already contain a bit of starter code sufficient for you to begin testing your work. VSCode also has the ability to allow you to start a terminal window, which will open placing you in a directory with all the files you need to complete and test the assignment, and with full access to the compiler for OCaml, the programming language we will be using this semester.
Before submitting an MP assignment, you MUST make sure that your MP compiles with the student grading script supplied with the assignment. If your MP fails to compile with the student grading script, your assignment will get NO CREDIT. There will be no partial credit for assignments that fail to compile.
You may do multiple commits of either the MPs or the WAs. Work submitted before the late deadline will not be subject to the late penalty, but work submitted after will.

Extensions
Each MP/AW will normally have an automatic 48-hour extension with a penalty on that MP/WA of 20% the total value of the assignment. If we cannot give such an extension for a particular MP/WA, for example due to scheduling constraints, we will announce that when the MP/WA is handed out.

During the automatic extension, staff is not obliged to answer questions for that MP/WA. You are on your own.

Extensions without a point penalty for the first 48 hours and any extension beyond the 48 hours will only be granted under very unusual circumstances such as a medical or family emergency. A signed note from a responsible party, or similar evidence, will be required. If you do need such an extension for some legitimate reason, do your best to let us know as soon as possible, preferably before the normal MP/WA deadline.

Regrade Policy
All grading is done automatically in PrairieLearn via algorithms that are fairly generic and in no way specialized to your code. A regrade for you will likely mean a regrade for the entire class. Requesting a regrade requires an explanation of why you believe your answer was incorrectly graded.

In order to have your regrade considered you must provide the following:

  • your netid;
  • what assignment or exam question was graded incorrectly; and
  • what evidence you have that your answer was incorrectly graded.
You must also submit your regrade request for a particular assignment within one week of receiving grades for that assignment. It must be submitted directly to the course instructor, not to the TAs. Late regrade requests will not be accepted or read.

Good reasons to ask for a regrade:

  • The grading was inconsistent with the description of how to do the problem given in class. Details need to be provided.
  • The grading was inconsistent with the problem statement. You must indicate what you believe the inconsistency to be.

Bad reasons to ask for a regrade:

  • Part of your answer "matched" the answer given in the solution. A partially correct answer is still wrong.
    "The difference between an almost right word and a right word is the difference between a lightning bug and lightning." -- Mark Twain
  • You wrote down two or more answers, only one of which was correct. Never put more than one answer for a question unless we tell you that such a thing is legitimate.
  • You expended a lot of effort answering the problem. We are measuring mastery, not effort.
  • You wrote something down.

Collaboration
You are allowed to collaborate on the machine problems (MPs) and the web assignments (WAs) of this course, in order to figure out how to solve the problem, resolve things you don't understand, and help each other track down errors or bugs. Nevertheless, you must each write and test your code separately and submit your own solution. Similarly, you must write up your own WA separately from others.

If your collaboration extended beyond understanding for what the problem was asking, then you should note on your assignment with whom you collaborated. As always, you are subject to the rules for plagiarism. Whether you pass this course or not will depend heavily on whether you pass the exams -- and those are non-collaborative.

We allow you to collaborate for several reasons:

  • substantial research done indicates that students learn more when they are allowed to work together;
  • our own ability to respond to student questions is increased because your peers are able to give help.
However, you have to collaborate intelligently in order to get the most out of it. If you ask a friend to describe the solution completely to you and then write it down, you will get the credit but you'll fail the exam because you never learned the methods/techniques/concepts. If you copy a friend's solution directly or substantially, that will be considered cheating, unless you give a clear cite of your source. If you work as a group, each writing part and sharing it with the others, that is also considered cheating, unless your cite all members from whom you copied. If you copied your answer from a source on the internet, that is considered cheating, unless you both cite your source, and clearly indicate what was copied. The penalties for being discovered cheating are described in the next section, below. If you offer your solution for others to copy, you should protect yourself from being accused of cheating by reporting this as well. Then, if some of those to whom you have lent your work fail to cite you, you will be protected from cheating accusations (unless they also claim they lent the same problem to you). If you copy your solutions from friends or other sources, you must cite your source, and the degree and extent of copying.

Think of MPs and web assignments as being part of the practice for the exam. Many of the problems will be used as a basis for the exam problems themselves. In fact, when it comes time to study, we will likely advise you to redo your MPs and written assignments.

Policy on Cheating

We will be looking for cheating on both assignments and exams. The penalty for being caught cheating a first time -- either sharing your solution or copying anyone else's solution on an exam, or copying anyone else's solution on an assignment without citation -- is that you will receive a negative score for the unit cheated on equal to the value of the unit. An assignment (MP or web assignment) is one unit. A numbered problem on a test, including all its parts, is one unit. The penalty if you are caught cheating a second time is a grade of F for the class. You should take all reasonable precautions to prevent others from cheating and report any suspected cheating.

Grading
All grading is done automatically in PrairieLearn, and you will receive your results for each problem when you press the Save & Grade button. You can see the scores of all past assessments in the PrairieLearn gradebook.

Grading Breakdown
Work Weight Notes
Machine Problems, and Web Assignments (combined)10%
Midterm 125%
Midterm 225%
Final Exam40%
ProjectNA Only for 4-unit graduate students

Textbooks
There is no required textbook for this course. However, the following textbooks are recommended reading: (see also the resources page)
  • The Objective Caml system, release 3.12 Documentation and user's manual by Xavier Leroy (with Damien Doligez, Jacques Garrigue, Didier Rémy and Jérôme Vouillon), from the official INRIA website for OCAML.
  • an online book about OCaml from CalTech.
  • Modern Compiler Implementation in ML by Andrew Appel. Published by Cambridge University Press. ISBN 0-521-60764-7 (paperback).
  • Compilers: Principles, Techniques, and Tools, also known as "The Dragon Book"; by Aho, Sethi, and Ullman. Published by Addison-Wesley. ISBN: 0-201-10088-6.
  • Essentials of Programming Languages, 2nd Edition; by Friedman, Wand, and Haynes. Published by MIT Press 2001. ISBN: 0-262-06217-8.
  • Advanced Programming Language Design, by Raphael A. Finkel. Addison Wesley Publishing Company, 1996.
  • Programming Language Pragmatics, by Michael L. Scott. Morgan Kaufman Publishers, 2000.
  • Concepts, Techniques, and Models of Computer Programming Peter Van Roy and Seif Haridi, MIT Press, 2004 ISBN 0-262-22069-5

README
Objectives
Contacting Staff
Submitting Assignments
Extensions
Regrade Policy
Collaboration
Policy on Cheating
Grading
Textbooks
FAQ