Indiana University -- Computer Science Department

C311, H311, A596 -- Programming Languages -- Spring 1997


General Information

Instructor
Christopher T. (Chris) Haynes, email chaynes@indiana.edu
Associate Instructor
Gustavo Gomez, email ggomezes@cs.indiana.edu
Credit Hours
4
Requirements
C335 (Prerequisite) and C343 (Corequisite)
Lecture
Sections 1156 (C311), 1159 (H311), and 8384 (A596) meet TR 2:30P-3:45P in GY126
Discussion Sections
Office Hours
Tuesday
  • 11:00A to 12:30P in LH 230 (Gustavo Gomez)
  • 1:10P to 2:10P in LH 230F (Chris Haynes)
Thursday
  • 9:30A to 11:00A in LH 230F (Chris Haynes)
  • 11:00A to 12:30P in LH 230 (Gustavo Gomez)
  • 1:10P to 2:10P in LH 230F (Chris Haynes)
Newsgroup
ac.csci.c311
Web URL (this document, updated throughout the semester)
http://www.cs.indiana.edu/classes/c311/
Catalog Description
Systematic approach to programming languages. Relationships among languages, properties and features of languages, and the computer environment necessary to use languages.


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. Special attention will be given to modeling the semantics of the Java language via a series of type checkers and interpreters.

(A slide presentation, available in condensed form, summarizes these points and others.)

Topics include


Materials

Required
Essentials of Programming Languages, by Friedman, Wand and Haynes. This text, known hereafter 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 may get it cheaper if you can find a grad or undergrad student who's taken C311 or C511 and is willing to part with it.
Recommended
The Little Schemer, by Friedman and Felleisen. This should also be available in the bookstores, and a couple copies are on reserve in the Swain Hall library. The Little Lisper is older, but similar. Some students have difficulty in this course because they have not mastered recursion. These little books are an excellent self-help solution to this problem.
Other
Should any other materials be required, they will be indicated here as the semester progresses.


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).

Adjustments of this syllabus will be announced in class and reflected on this web page. Links in the list below are to lecture scripts, which may be revised shortly before and/or after the lectures.

Week of:

Jan 13
(Re)introduction to Scheme: EOPL preface and chapter 1, chapter 2 through section 2, and chapter 3 through section 3.
Jan 20
Static Properties of Programs: EOPL, remainder of chapters 2 and 3.
Jan 27
Quiz. Imperative programming: EOPL section 4.5. Simple interpreters: EOPL chapter 5 through section 3.
Feb 3
Procedures and assignment: EOPL, sections 4.6 and 5.3 through 5.5.
Feb 10
Recursion and dynamic scope: EOPL, rest of chapter 5.
Feb 17
Continuation-passing style: EOPL chapter 8 sections 1, 2, 3, and 5.
Feb 24
CPS rules: EOPL chapter 8 sections 4, 7, and 8. First exam.
Mar 3
Representation-independent interpreter, continuations as records, and reified continuations: EOPL sections 9.1 through 9.3. First-class continuations and exception handling.
Mar 10
Imperative form and control stack architecture: EOPL sections 10:1 and 10:2, thoroughly.
Mar 17
Enjoy spring break!
Mar 24
Environment stack architecture: EOPL, rest of chapter 10 for general information: not responsible for code details. Parameter passing: EOPL chapter 6; not responsible for material involving arrays.
Mar 31
Second exam. Paramater passing, continued; stack architecture EOPL section 7.1.
Apr 7
Object-oriented programming: data abstraction and object (actors). code reuse, polymorphism, and virtual methods.
Apr 14
Object-oriented programming, Part II: code reuse, polymorphism, and virtual methods. EOPL section 7.2 for general information.
Apr 21
Object-oriented programming, Part III: casting, subtyping, parameterized types. A slides from a general talk on Java may also be of interest.
Apr 28
Synchronization mechanisms and errors with Java threads.

Assignments

For the most part, assignments will be handed in by email to an automatic checker with feedback emailed back almost immediately. Assignments may be prepared on the system of your choice, but should run properly using Chez Scheme version 5. Homework will be graded by hand, but the automatic checker will detect some errors.

You are welcome to collaborate with others in the class, tutors, etc., but in every case, if you have received help on an assignment from anyone other than the instructor or associate instructor of the course, their names must be indicated at the beginning of the assignment. Though you are encouraged to work on assignments in groups, each individual is responsible for submitting their own copy of each assignment.

An assignment will usually be given each week. Unless there is an announcement to the contrary, assignments will be added to the table below by 5:00P on Monday and due before midnight of Tuesday the following week. Late assignments will not be accepted.

# Assignment Due Solution
1 Basic Scheme M 1/27 @ 5pm a1.ss
2 Static Properties T 2/4 @ 11:59pm a2.ss
3 Simple Interpreter T 2/11 @ 11:59pm a3.ss
4 Procedures and Assignment T 2/18 @ 11:59pm a4.ss
5 Recursion and Dynamic Scope T 2/25 @ 11:59pm a5.ss
6 CPS Transformation R 3/6 @ 11:59pm a6.ss
7 CPS with Abstract Continuations R 3/13 @ 11:59pm a7.ss
8 CPS with Registers and Stacks R 3/27 @ 11:59pm a8.html
- Exam 2. No assignment. T 4/1 @ 2:30pm exam2.html
9 Call by value/Call by reference R 4/10 @ 11:59pm a9.html
10 Simple Object Oriented Programming R 4/17 @ 11:59pm a10.ss
11 Closures in Java S 4/27 @ 11:59pm TestMapVector


Tools and Advise

Attendance at discussion sections is mandatory. Often 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!

Our web has information on use of Scheme at IU, including emacs support. We will be using a few Scheme extensions not mentioned in EOPL.

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.

Though emacs is a big help, 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.

The assignments don't count a whole lot toward your grade, but extensive experience has shown that students who do not make a serious effort to do the assignments do poorly on exams. Experience has also shown that if most students spent much more time with paper and pencil before approaching a computer, they would spend much less time debugging, and better understand their programs. An hour with a pencil is often worth several at the keyboard!

If you're having difficulty, don't hesitate to see the instructor or AI during office hours. If these times are not convenient, see us after class or discussion, or contact us by email or phone, to set up another time. We're here to help you!


Grading

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

The sample exams are provided only to provide a general idea of what to expect. The content of the course this semester differs somewhat, especially after the second exam.


Administrivia

Incompletes
An incomplete (I) final grade will be given only by prior arrangement in exceptional circumstances conforming to departmental policy in which the bulk of course work has been completed in passing fashion.
Possibly Important Dates
Academic integrity
For your ethical pleasure, you should read the Computer Science Department statement on academic integrity. It's dry, but important.

Course Evaluation

Before the end of the semester, please complete the electronic Course evaluation forms for Chris Haynes and your discussion section AI, Gustavo Gomez.


Chris Haynes / chaynes@indiana.edu