C311 -- Spring 1996

Programming Languages

Class Information

Instructor
Christopher T. (Chris) Haynes
Associate Instructors
Vikram Subramaniam and Erik Hilsdale.
Credit Hours
4
Requirements
C335 (Prerequisite) and C343 (Pre- or Corequisite)
Lecture
Section 2128 meets Monday, Wednesday, and Friday, 9:05am to 9:55am in WH 109
Discussion Sections
Office Hours
Monday
  • 10:30am to 12:00pm in LH 230e (Vikram Subramaniam)
  • 10:30am to 12:00pm in LH 230f (Chris Haynes)
  • 1:00pm to 2:30pm in LH 230c (Erik Hilsdale)
Wednesday
  • 10:30am to 12:00pm in LH 230f (Chris Haynes)
  • 1:00pm to 2:00pm in LH 230c (Erik Hilsdale)
Friday
  • 10:30am to 12:00pm in LH 230e (Vikram Subramaniam)
Local newsgroup
ac.c.311
Web URL
http://www.cs.indiana.edu/classes/c311/

Overview

This course provides an introduction to the foundations of programming languages, allowing a thorough understanding of programming language semantics and critical implementation characteristics. This provides the basis for the best choice and use of existing languages, as well as language design.

Interpreters and other language-processing programs are used throughout to present the essential elements of programming languages in a precise, analytic, manner. The extensive use of interpreters in this course also develops skill in meta-linguistic abstraction -- a powerful programming paradigm.

To thoroughly understand programming languages (or most any topic), it is necessary to have a variety of models, or views, at varying levels of abstraction. In this course we will employ a range of models from very high-level (almost mathematical semantics) to very low-level (almost assembly language), and emphasize the connections between levels.

Scheme is used as a meta-programming language throughout the course, but this course is about fundamentals that are the basis for most programming languages, not just Scheme.

Topics include

Materials

Required
Essentials of Programming Languages, by Friedman, Wand and Haynes. This text, known as EOPL, should be available in any of the three big textbook bookstores (T.I.S, Aristotle's or the I.U. Bookstore), but you can get it cheaper if you can find an old grad student or undergrad who's taken C511 or C311.
Recommended
The Little Schemer, by Friedman and Felleisen. This should also be available in the bookstores. Old copies of The Little Lisper may also be helpful. A few copies of The Little Schemer will be placed on reserve in the Swain Hall library.
Other
Other materials may be required through the semester. These materials will be announced in class and will be made available through the White Rabbit on Indiana (near Kirkwood) and will cost a few dollars to cover copying costs.

Evolving Syllabus

Read the indicated material for each week before the week begins! You are not expected to understand the material on first reading, but having read it once first you will be much better prepared for class and discussion sections. Read the material for the first two weeks in the first week (much of it should be review).
Week of January 8
(re)Introduction to Scheme. EOPL preface and chapter 1, chapter 2 through section 2, and chapter 3 through section 3.
Week of January 15
Static Properties of Programs. EOPL, remainder of chapters 2 and 3.
Week of January 22
Simple interpreters. EOPL chapter 4 sections 5 and 6, and chapter 5 through section 3.
Week of January 29th
Procedures and assignment. EOPL, sections 5.4 and 5.5.
Week of February 5th
Recursion and dynamic scope. EOPL, rest of chapter 5.
Weeks of February 12th and 19th
Continuation-passing style. EOPL chapter 8.
Week of February 26th
Representation-independent interpreter, continuations as records, and reified continuations. EOPL sections 9.1 through 9.3.
Week of March 4th
First-class continuations and exception handling. Continuation notes
Week of March 18th
Imperative form and control stack architecture. EOPL sections 10.1 and 10.2, thoroughly.
Week of March 25th
Environment stack architecture. Parameter passing. EOPL, rest of chapter 10 for general information: not responsible for code details. Handout call-by.ss and EOPL chapter 6; not responsible for material involving array.
Week of April 1st
Second exam. More comments on parameter passing. Introduction to Java and object-oriented programming.EOPL section 7.1.
Week of April 8th
Java programming tutorial. Static-methods-only Java interpreter. Handout java1.ss.
Week of April 15th
More object-oriented programming, Java style. EOPL section 7.2.
Week of April 22th
More object-oriented programming, Java style. Also emphasis on the importance of virtual member functions in C++, as illustrated by virtual.C.

Classes

Attendance at discussion sections is mandatory. Usually, a problem or set of problems will be given out at the beginning of discussion section and the class will be broken up into small groups to solve the problems. The AI leading the discussion section will go between groups answering questions and asking questions about the work done so far and about the class material. Your answers to these questions, and your progress on the problems given in discussion section, will count toward your final grade.

Some lectures may also be conducted in this manner, and some other lectures will present material not found in the book. Don't miss class!

Assignments

One assignment will usually be given each week. Assignments will be made public by 9:00 AM Monday and due before 9:00 AM the next Monday.

For the most part, assignments will be handed in by email to an automatic checker and results emailed back almost immediately. Assignments may be prepared on the system of your choice, but should run properly using Chez Scheme. Homeworks will be graded by hand, but the automatic checker will provide feedback as to the correctness of the submissions.

  1. Basic Scheme -- solution
  2. More Basic Scheme -- solution
  3. Static Properties -- solution
  4. Simple interpreter -- solution
  5. Procedure interpreter -- solution
  6. Recursion and dynamic scope -- solution
  7. The CPS Conversion -- solution
  8. The CPS Conversion (continued) -- solution
  9. CPS and Representation -- solution
  10. Paramters and Exceptions -- solution
  11. Registers and Stacks -- solution
  12. Parameter Passing -- solution
  13. Basic Java -- solution
  14. Conditionals and Looping -- solution

Tools

Emacs is our most important tool, so you may want to get emacs optimized for Scheme programming before trying the projects.

For later interpreters we will be using the define-record and variant-case macros. Both of these are defined (for Chez Scheme version 5) in the file record.ss.

Since we're going to be talking about Sun's new miracle language, Java, an introduction (of sorts) is available.

Indentation

Points will be deducted on the homework, quiz, and exams if the cardinal rules of indentation are violated, so make it a habit to follow them whenever you write Scheme code. This will greatly aid your Scheme programming.

The Scheme emacs support automatically indents code in accordance with these rules, and includes a command for automatically checking and correcting the indentation of a definition after it has been edited. However, it is strongly suggested that you write solutions to all exercises by hand and check them carefully for correctness before approaching a computer. This will give you practice at indentation by hand (which is necessary for exams) and, more importantly, it is in most cases much easier to find mistakes in this course's exercises by thinking about them than by debugging. An hour with a pencil is worth several at the keyboard! (Remember this if you are bothered by large amounts of time spent at the keyboard completing your assignments.)

Evaluation

The following is a tentative schedule for evaluation, with approximate percentage contributions to the final grade.

Administrivia

Course Evaluations

Before the end of the semester, please complete the electronic Course evaluation forms for Chris Haynes and your discussion section AI, either Vikram Subramaniam or Erik Hilsdale. The department does look at the (anonymous) evaluations, and--perhaps more importantly--we do too; so do next year's students a favor and give some constructive criticism.


Back to IU Computer Science.

chaynes@cs.indiana.edu
vsubrama@cs.indiana.edu
ehilsdal@cs.indiana.edu
Sun Jan 7 15:12:47 EST 1996