Programming Languages

Tuesday 5:00-7:00
Room 101, Warren Weaver Hall
Recitation: Monday 6:00-7:00, WWH 101
Professor Ernest Davis

Reaching Me

Prerequisites: None.

Textbook: Programming Language Pragmatics, 2nd Ed. by Michael Scott, Morgan Kaufman, 2005

Languages to be discussed

C++, Java, Ada, Scheme, ML.



Problem sets (20%)
Programming assignments in Java, C++, Ada, and Scheme (40%)
Final exam (40%)

Class email list

Link to the class email web page and follow the instructions there for subscribing.

Teaching Assistant

The TA will be Samantha Kleinberg. She will be holding office hours Mondays 4:00-5:00 in her office, room 1013 in 715 Broadway. Phone: x8-3488. Email:

Samantha's notes

Lecture Notes and Readings

Introduction. Syntax. Scott, chap. 1, chap 2 through sec. 2.1.
Statement level control structures. Scott, Chap. 6 through sec 6.5 except 6.5.3.
Memory Allocation. Scott, Chap 3 through sec 3.2; p. 354-356 (for semi-dynamic arrays); pp. 383-386 (for garbage collection).
Names and Scope. Scott chap 3, sections 3.1, 3.2, 3.3 except 3.3.4 and 3.3.5 on modules.
Types. Scott chap 7, sections 7.1-7.4 and 7.7.
Parameter Passing . Scott, Chap. 8 through 8.3 except the discussion of closures p. 424.
Modules and OOP. Scott, chap. 9 except 9.4.4 and 9.4.5, and section 14.6 (pp. 781-784) on linking.
Generics. Scott, section 8.4. Also Generics in the Java Programming Language by Gilad Bracha.
Exceptions. Scott, section 8.5.
Concurrency. Do not attempt Scott chap. 12, unless you are really eager for a challenge.
Notes on Ada
Passing Functions as Parameters
Scheme continued.
ML Datatypes
Prolog Notes
Lazy Evaluation

Sample Code
sample1.cpp Basic C++ program
sample2.cpp Passing a Function as an Argument
applier.cpp Template
intBinarySearchTree.cpp Integer Binary Search Tree: A simple class definition
sizedBinarySearchTree.cpp Sized Binary Search Tree: Derived classes
binarySearchTree.cpp Binary Search Tree: Template
generalBinarySearchTree.cpp General Binary Search Tree: Combining a Template with a Derived Class
Prolog Input

Synchronization examples

Simulated race condition in Java
Mutual exclusion in Java (synchronized methods)
Parallel Primality testing in Java
Readers-Writers code in Ada: Declaration.
Readers-Writers code in Ada: Body.
Readers-Writers code with tracing in Ada: Declaration.
Readers-Writers code with tracing in Ada: Body.
Driver for readers-writers code: Body.
Barrier synchronization in Ada applied to Pascal's triangle

Sample Ada Programs

Sample Ada Programs


Reference Materials

Final Exam

The final exam will be given on Tuesday, May 12.
Notes on Final Exam
Sample Final Exam
Sample Final Exam Answers