Syllabus --Spring 2017
Our class meets twice a week, at different times:
Shillman Hall 220, Tuesday 11:45 AM – 1:25 PM, and Thursday 2:50 – 4:30 PM
Mon 3:00 – 4:30 PM,
Wed 4:00 – 6:00 PM
CS 4410 covers the implementation of efficient compilers for programming languages. The course focuses on the connections between language features and the impact they have on the design of a compilier, including any associated algorithms and pragmatic issues, and practical applications including those outside of programming languages proper. Participants build a working compiler including lexical analysis, parsing, type checking, code generation, and register allocation. As a secondary emphasis, the course exposes students to run-time issues and optimization.
This course assumes familiarity with programming in the style of How to Design Programs, and basic knowledge of functional programming as introduced in CS 2510, and C programming as introduced in CS3650.
At the moment, I am not planning on giving formal exams. However, we will likely have two or three written assignments (as opposed to the project assignments) that will serve a similar purpose. There is a final exam time scheduled for this course, but we may not use it. We will likely have project presentations due during exam week, so don’t assume the course is over before then.
Programming assignments will use several pieces of software:
OCaml, version 4.0 – note that newer versions of OCaml have defined a few new types and functions that, while convenient, are not yet available everywhere.
nasm, an open-source assembler
Valgrind, a tool for checking memory-safety
Clang, a compiler for C programs. (You may use gcc if you prefer, but you’ll be on your own to ensure that everything works correctly.)
There is no specific IDE for OCaml; I tend to use emacs, but you may use any editor you wish.
There is no required textbook, but you may find these books useful.
Introduction to Objective Caml, book on OCaml by Jason Hickey (online version)
A nice OCaml overview by Scott Smith
Some OCaml tutorials
Comparison of SML and OCaml, by Andreas Rossberg
See the INRIA web pages for information on ocamllex and ocamlyacc.
An interactive tutorial on using Git
This table specifies the lecture schedule; topics are tentative.
Topics (tentative and approximate)
Introduction, OCaml practice
Tiny compiler: grammar, abstract syntax, and instructions
Names, scope and (simple) stacks
Multiple data types and tagging values
Errors and calling functions
Overflow and Tail Calls
Heap allocation and pairs
Automated memory management, Mark/compact
No class: Spring Break
No class: Spring Break
No class: Snow day
Types and Compilation
Intermediate representations, abstract locations, and register allocation
Optimization, generally: CSE & more
Testing your code is sufficiently important that we’ve devoted an entire page to it. Please read these notes, for each and every assignment you work on.
Homework will usually be due at 8:59 PM; the day of the week varies, so you should check each individual assignment to be sure. General homework policies are here.
This homework schedule is tentative and subject to change at the instructor’s discretion.
You may not collaborate with anyone on any of the exams. You may not use any electronic tools, including phones, tablets, netbooks, laptops, desktop computers, etc. If in doubt, ask a member of the course staff.
All homework assignments will be completed with a partner; some may involve a larger team (TBD). You must collaborate with your assigned partner or team, as specified, on homework assignments. You may request help from any staff member on homework. (When you are working with a partner, we strongly recommend that you request help with your partner, rather than solo.) You may use the Piazza bulletin board to ask questions regarding assignments, so long as your questions (and answers) do not reveal information regarding solutions. You may not get any help from anyone else on a homework assignment; all material submitted must be your own. If in doubt, ask a member of the course staff.
Providing illicit help to another student is also cheating, and will be punished the same as receiving illicit help. It is your responsibility to safeguard your own work.
Students who cheat will be reported to the university’s office on academic integrity and penalized by the course staff, at our discretion, up to and including failing the course.
If you are unclear on any of these policies, please ask a member of the course staff.
In general, you should submit your homework according to the instructions on the web page for the individual assignments.
Homework will ordinarily be submitted to the CS 4410 submission server at https://handins.ccs.neu.edu. However, sometimes (detailed below) it may be necessary to submit by email. In this case, email your instructor with the subject line “HW N submission” (where N is the appropriate homework number). Attach your source files to the email individually; do not use a ZIP file or other kind of archive.
If you have trouble submitting to the server and you have time before the deadline, please wait few minutes and try again; it may also be worth checking on Piazza to find out whether other students are experiencing similar difficulties. If upon retrying you still cannot submit, email Dr. Lerner (blerner@ccs). Or if you don’t have time to try again then you should submit by email.
Each student gets four free, no-questions-asked late days for the term.
The purpose of late days is make the extension process fair and
transparent by getting the instructors out of the extension-granting
business entirely. Instead, when you need an extension, you can take
Using a late day is automatic: simply submit the homework up to one day late. The server will keep track of the number of used late days. Conserve your late days carefully.
No more than one late day may be used on any one homework. Late days cannot be divided fractionally, but must be used whole. Late days cannot be transferred to or shared with a partner, so in order to take an extension both you and your partner must have sufficient late days remaining. Choose your partners carefully.
Your grade will be based on your performance on the problem sets, and the written assignments; exact weights TBD.
The grades will computed on an absolute basis: there will be no overall curving. The instructor may choose to curve an individual homework or exam, but please do not bank on such a chance.
The mapping of raw point totals to letter grades is given below. Please note that these grade boundaries may move slightly at the discretion of the instructor, but the grade boundary for A is unlikely to change.