Princeton University
Computer Science Department

Computer Science 217
Introduction to Programming Systems

Andrew W. Appel

Fall 2003


Directory
General Information | Schedule | Assignments | Announcements | Policies

Week 1: 9/11 - 9/14

Reading (required): The Game of Kalah

Reading (recommended): Kernighan & Pike (The Practice of Programming) 4

Lecture 1: (Thursday) Introduction; Modules & Interfaces


Week 2: 9/15 - 9/21

Reading (required): Loukides & Oram 2, 3, 4, 6

Reading (recommended): Kernighan & Pike (The Practice of Programming) 1

Precept 1: (Monday/Tuesday) Introduction; The Program Preparation Process

Lecture 2: (Tuesday) Modules & Interfaces

Precept 2: (Wednesday/Thursday) Emacs; Gdb

Lecture 3: (Thursday) Programming Style; Scope

(Sunday) String Functions Assignment Due


Week 3: 9/22 - 9/28

Reading (required): King 15, 17.1-6, 19, Kernighan & Pike (The Practice of Programming) 2.7, 2.9

Reading (recommended): Kernighan & Pike (The Practice of Programming) 4.5, 4.6

Precept 3: (Monday/Tuesday) Advanced C: Dynamic Memory Management

Lecture 4: (Tuesday) ADTs; Software Design; Hashing

Precept 4: (Wednesday/Thursday) Advanced C: Void Pointers and Generic ADTs

Lecture 5: (Thursday) Dynamic Memory Management


Week 4: 9/29 - 10/5

Reading (required): King 10, 17.7, 18; McGill notes; Rich 12

Precept 5: (Monday/Tuesday) Advanced C: Function Pointers and Generic ADTs

Lecture 6: (Tuesday) Game playing programs; Alpha-beta search

Precept 6: (Wednesday/Thursday) Hash Tables; Advanced C: Declarations, Definitions, Scope, Linkage, Duration

Lecture 7: (Thursday) Incremental evaluation in alpha-beta

(Sunday) Symbol Table ADT Assignment Due


Week 5: 10/6 - 10/12

Reading (required): Loukides & Oram 7

Reading (recommended): Kernighan & Pike (The Practice of Programming) 6, 7

Precept 7: (Monday/Tuesday) Game Player Team Discussion (attendance is mandatory)

Lecture 8: (Tuesday) Testing and profiling

Precept 8: (Wednesday/Thursday) Make; Game Player Team Discussion (attendance is mandatory)

Lecture 9: (Thursday) Robust programming


Week 6: 10/13 - 10/19

Reading (required): Loukides & Oram 9

Precept 9: (Monday/Tuesday) Gprof; Game Player Team Discussion (attendance is mandatory)

Lecture 10: (Tuesday) Operating systems; Buffered I/O

Precept 10: (Wednesday/Thursday) UNIX and Bash; Game Player Team Discussion (attendance is mandatory)

Lecture 11: (Thursday) Processes; fork/exec

(Sunday) Kalah Player Assignment Due


Week 7: 10/20 - 10/26

Reading (required): Kernighan & Pike (The UNIX Programming Environment) 7.4

Precept 11: (Monday/Tuesday) UNIX Processes

Lecture 12: (Tuesday) Interprocess communication; pipe/dup

Precept 12: (Wednesday/Thursday) UNIX Processes (cont.)

Lecture 13: (Thursday) Sparc architecture

(Thursday) Midterm Examination: 7:30 PM in CS 104. (Last year's midterm exam and answers, midterm exam preparation guide)

This year's exam and answers


Week 8: 10/27 - 11/2

(Monday - Sunday) Fall Recess


Week 9: 11/3 - 11/9

Reading (required): Kernighan & Pike (The UNIX Programming Environment) 7.5

Precept 13: (Monday/Tuesday) UNIX Low-Level I/O and Pipes

Lecture 14: (Tuesday) Sparc instructions

Precept 14: (Wednesday/Thursday) UNIX Signals and Alarms

Lecture 15: (Thursday) Number systems

(Sunday) Kalah Referee Assignment Due


Week 10: 11/10 - 11/16

Reading (required): Paul 2.1-4, 3, 4, 9

Precept 15: (Monday/Tuesday) Assembly Language: Getting Started

Lecture 16: (Tuesday) Branching

Precept 16: (Wednesday/Thursday) Assembly Language Fundamentals

Lecture 17: (Thursday) Procedure Calls


Week 11: 11/17 - 11/23

Reading (required): Paul 2.5-13, 5, 7

Precept 17: (Monday/Tuesday) Assembly Language Branching; Gdb for Assembly Language

Lecture 18: (Tuesday) Assembly Language Stack and Subroutines (Note: Andrew Appel will be on travel, so Bob Dondero will present this lecture. The lecture will be in the style of a typical precept, will build on the material that was covered in Precept 16, and will be prerequisite for the material to be covered in Precept 18.)

Precept 18: (Wednesday/Thursday) Assembly Language Leaf Subroutines and Optimization

Lecture 19: (Thursday) Combinational circuits

(Sunday) UNIX Commands in SPARC Assembly Language Assignment Due


Week 12: 11/24 - 11/30

Reading (required): King 16.4-5, 19.1-2

Precept 19: (Monday/Tuesday) Circuit Simulator (Interpreted Version)

Lecture 20: (Tuesday) Sequential circuits

(Thursday - Sunday) Thanksgiving Holiday


Week 13: 12/1 - 12/7

Precept 20: (Monday/Tuesday) Circuit Simulator (Interpreted Version)

Lecture 21: (Tuesday) Parsing

Precept 21: (Wednesday/Thursday) Digital Circuit Examples

Lecture 22: (Thursday) Building a computer


Week 14: 12/8 - 12/14

Reading (required): Paul 8; King 20; Appel

Precept 22: (Monday/Tuesday) SPARC Assembler, Linker, and Machine Language

Lecture 23: (Tuesday) Assemblers & Linkers

(Tuesday) Digital Circuit Simulator (Interpreted Version) Assignment Due

Precept 23: (Wednesday/Thursday) Circuit Simulator: Compiled Version

Lecture 24: (Thursday) Software engineering


Week 15: 12/15 - 12/21

(Monday - Sunday) Winter Recess


Week 16: 12/22 - 12/28

(Monday - Sunday) Winter Recess


Week 17: 12/29 - 1/4

(Monday - Sunday) Winter Recess


Week 18: 1/5 - 1/11

(Monday - Sunday) Reading Period


Week 19: 1/12 - 1/18

(Monday) Reading Period

(Tuesday) Dean's Date

(Tuesday) Digital Circuit Simulator (Compiled Version) Assignment Due

(Thursday) Exam Preparation Session: 3:00 PM - 4:00 PM, Friend Center 110, conducted by Benedict Brown

(Friday) Exam Preparation Session: 1:00 PM - 2:00 PM, Friend Center 110, conducted by Bob Dondero


Week 20: 1/19 - 1/24

(Monday) Final Exam: Jan 19th, 8:30 a.m., Frick Chemistry Lab, room 324 (Last year's final exam and answers, final exam preparation guide)

This year's exam and answers


All lecture notes are copyright 2001, 2002, 2003 by Andrew W. Appel, Thomas Funkhouser, David R. Hanson, Larry Peterson, and/or Randolph Wang. All precept handouts are copyright 2001, 2002, 2003 by Robert M. Dondero, Jr.  Permission to reproduce these notes for not-for-profit educational purposes is hereby granted. These notes may not be reproduced for commercial purposes without the express written consent of the author.