C311/A596: Programming Languages (Fall 98)

Indiana University, Computer Science Department


Final Grades

General Information

Instructor
Christopher Haynes (Chris), phone 855-3376, office LH230F, email chaynes@indiana.edu
Associate Instructor
Ayse Koprulu, email akoprulu@cs.indiana.edu
Credit Hours
4
Requirements
C335 (Prerequisite) and C343 (Corequisite)
Lecture
Sections 1389 (C311) and 1349 (A596) meet MW 1:00P to 2:15P in LH102
Discussion Sections
Sections 1390 (C311) and 1350 (A596) meet M 2:30P to 3:20P in BH016
Section 1391 (C311) and 1351 (A596) meet W 2:30P to 3:20P in SY0007
Office Hours
Chris: M 2:25P-3:55P, F 9:00A-10:00A, and F 11:30A-12:00P in LH230F
Ayse: M 8:00A-11:00A in LH330A
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. Scheme is used as a meta-programming language throughout much of the course, but this course is about fundamentals that are the basis for most programming languages, not just Scheme.

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.

The last part of the course will focus on a variety of issues in object-oriented programming and multi-tasking, with emphasis on these facilities in Java.

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

Topics include


Textbooks

Required
Essentials of Programming Languages, by Friedman, Wand, and Haynes. (MIT Press, ISBN 0-262-06145-7.)
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.

The Java Programming Language, by Arnold and Gosling, second edition. (Addison-Wesley, ISBN 0201310066.)
The basic reference on the Java language, known hereafter as JPL.

Recommended
The Little Schemer, by Friedman and Felleisen. (MIT Press ISBN 0-262-56099-2.)
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.

The Scheme Programming Language (2nd edition), by Dybvig. (Prentice Hall, ISBN 0-13-454646-6.)
A standard reference on Scheme programming.


Syllabus

Read the indicated material for each week before the week begins! Chapter, section, and exercise numbers refer to EOPL unless otherwise indicated. You are not expected to understand the material on first reading, but having read it once 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).

The following syllabus is still tentative and incomplete. Adjustments will be reflected on this page as we go.

Aug 31
(Re)introduction to Scheme: EOPL preface and chapter 1, chapter 2 through section 2, and chapter 3 through section 3.
Sep 7
Static Properties of Programs: EOPL, remainder of chapters 2 and 3.
Sep 14
Quiz Sep 14 on EOPL through section 2.2 (Write, in 45 minutes, several programs similar to those in the first assignment: sample quiz.) Imperative programming: EOPL section 4.5. Simple interpreters: EOPL chapter 5 through section 3.
Sep 21
Procedures and assignment: EOPL, sections 4.6 and 5.3 through 5.5.
Sep 28
Recursion and dynamic scope: EOPL, rest of chapter 5.
Oct 5
Continuation-passing style: EOPL chapter 8 sections 1, 2, 3, and 5.
Oct 12
CPS rules: EOPL chapter 8 sections 4, 7, and 8.
Oct 19
First exam Oct 21 on EOPL chapters 1-5. (Sample exams: Fall 1995 and Spring 1997)
Oct 26
Imperative form and stack architecture: EOPL sections 10:1 and 10:2 thoroughly, skim rest of chapter 10.
Nov 2
Representation-independent interpreter, continuations as records, and reified continuations: EOPL sections 9.1 through 9.3. First-class continuations and exception handling.
Nov 16
Stack architecture and parameter passing.Elementary object-oriented programming: data abstraction and object (actors). EOPL section 7.1. JPL skim chapters 1 and 2. Second exam Nov 18 on EOPL chapters 6, 8, 9, 10. (Sample exam: Spring 1997)
Nov 23
Inheritance, polymorphism, and virtual methods. EOPL section 7.2 for general information, JPL chapter 3 with emphasis on sections 1, 4, 6, 8, 10, and 11. Java inner classes. JPL sections 2.12. (If you're interested in the full details of inner classes, check out the official specification.) Thanksgiving break.
Nov 30
Java type system. JPL chapter 4 and 5.14.
Dec 7
Synchronization mechanisms and errors with Java threads. JPL sections 9.1-9.6 and 9.8.
Dec 16 Wednesday 5-7PM
Final Exam on the whole course, with emphasis on material after the second exam.

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 (in fact, encouraged) 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 should 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 be posted below, usually each week before Wednesday's class and due by midnight on Thursday of the following week. Late assignments will not be accepted.

# Assignment Due Solution
1 Basic Scheme R 9/10 @ 11:59pm assign1.ss
- QUIZ - quiz.ss
2 Static Properties, Parsing T 9/22 @ 11:59pm assign2.ss
3 Simple Interpreters R 10/1 @ 11:59pm assign3.ss
4 Assignment Mon 10/12 @ 11:59pm assign4.ss
5 Dynamic scope Sun 10/18 @ 11:59pm assign5.ss
- FIRST EXAM - exam1.html
6 CPS Sun 11/2 @ 11:59pm assign6.ss
7 Data structure representation Sun 11/8 @ 11:59pm assign7.ss
8 CPS with registers and stacks Sun 11/15 @ 11:59pm assign8.ss
- SECOND EXAM - exam2.ss
9 Java inheritance M 12/7 @ 11:59pm assign9
10 Classes, interfaces, and overloading F 12/11 @ 11:59pm assign10.java

Tools and Advice

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. With this emacs support loaded, you can reduce indentation, for example on the line following type-case, by selecting the menu option Scheme->Indentation->indent for CPS.

The DrScheme programming environment is also highly recommended. It is installed on UITS systems, and is free if you would like to install it on your own Windows95/NT or Unix system.

We will be using a few Scheme extensions not mentioned in EOPL. The define-record and variant-case syntactic extensions used in the book are available in Chez Scheme by loading record.ss.

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.


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.
Academic integrity
For your ethical edification, read the Computer Science Department statement on academic integrity. It's dry, but important.
Possibly important dates
W 10/28: last day to withdraw without approval
W 12/2: last day to withdraw with Dean's approval Makeups

Course Evaluation

Before the end of the semester, please complete the electronic Course evaluation forms for Chris Haynes and your discussion section AI, Ayse Koprulu, will become available via links here.


chaynes@indiana.edu