C311 -- Spring 1996
Programming Languages
- 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
-
- Section 2129 meets Tuesday, 2:30pm to 3:20pm in BH 321
(Erik Hilsdale)
- Section 2130 meets Thursday, 1:25pm to 2:15pm in BU 108
(Vikram Subramaniam)
- 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/
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
- Induction, Recursion, and Scope
- Direct semantics interpreters
- Object-oriented semantics
- Continuation-passing style
- Continuation-semantics interpreter
- Imperative form and stack architecture
- 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.
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!
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.
- Basic Scheme --
solution
- More Basic Scheme --
solution
- Static Properties --
solution
- Simple interpreter --
solution
- Procedure interpreter --
solution
- Recursion and dynamic scope --
solution
- The CPS Conversion --
solution
- The CPS Conversion (continued) --
solution
- CPS and Representation --
solution
- Paramters and Exceptions --
solution
- Registers and Stacks --
solution
- Parameter Passing --
solution
- Basic Java --
solution
- Conditionals and Looping --
solution
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.)
The following is a tentative schedule for evaluation, with approximate
percentage contributions to the final grade.
- Self assessment Quizette; 0 percent.
- Scheme Quiz -- Monday, January 22, in class; 10 percent. You will be
asked to write, in 25 minutes, several programs similar to those in the first
assignment.
- Exam One -- Monday, February 19, in
class, on EOPL chapters 1 through 5; 20 percent.
- Exam Two -- Monday, April 1st, in class;
20 percent.
- Final Exam -- Friday, May 3, 8:00am to 10:00am; 35 percent. The final
will cover the whole course, with emphasis on material since the second exam.
- Assignments; 10 percent. (They don't count a whole lot, but somehow
students who do not make a serious effort to do the assignments
independently do poorly on exams.)
- Subjective assessment based on attendance, participation, and
preparation for lectures and discussion sessions; 5 percent.
- For your ethical pleasure, you should read the Computer
Science Department statement on academic
integrity. It's dry, but important.
- 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
- Monday, February 5 -- Last day to Pass/Fail the course.
- Wednesday, March 6 -- Last day to Drop the course on your own.
- Thursday, April 18 -- Last day to Drop the course with a Dean's approval.
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