|
CS-257: Nonimperative Programming: Scheme! Computer Science Department University of New Mexico Spring 2008 |
|
Instructor:
Joel Castellanos
This course uses Scheme, a multi-paradigm programming language
that is best known for its support of functional programming.
Functional programming is a programming paradigm that treats
computation as the evaluation of mathematical functions and
avoids state and mutable objects (objects that can be changed after
being created). Functional programming emphasizes the application
of functions, in contrast with the imperative programming style
that emphasizes changes in state. Functional programming
languages have largely been emphasized in academia rather than
in commercial software development. However, notable functional
programming languages used in industry and commercial
applications include Erlang (concurrent applications), R
(statistics), Mathematica (symbolic math), ML (analyzers, and theorem provers),
K (financial analysis), and XSLT (Stylesheet to human readable).
This course is primarily a programming course.
We will work through each chapter of the textbook in the order presented by the
textbook. There will be weekly programming assignments,
most of which will come from outside of the textbook. As fractals are
so naturally expressed in functional languages, they will be a major
application topic and source of assignments. Another area in which Scheme excels is
Artificial Intelligence; thus AI games will form another major
topic for programming assignments.
Foreword by Gerald J. Sussman:
This is NOT a required textbook. There will, however, be some short selected readings from it placed on electronic reserve.
The course will also uses DrScheme,
an interactive, integrated, graphical programming environment for MzScheme.
If you play on a UNM sports team that requires travel this semester,
then you must give me your game and travel schedule early in the semester.
Office: Farris Engineering Center (FEC) 321
Office hours (Spring 2008):
Monday & Wednesday: 11:00-noon,
Tuesday: 8:00 - 9:15 AM
and by appointment.
e-mail: joel@unm.edu
Course Description
In computer science, imperative programming is a programming
paradigm that describes computation as statements that change the
state of a program. The hardware implementation of almost all
computers is imperative. From this low-level perspective, the
program state is defined by the contents of memory, and the
statements are instructions in the computer’s native machine
language. Higher-level imperative languages, such as FORTRAN and C,
use variables and more complex statements, but still follow the
same paradigm. Object-oriented languages, such as C++ and Java,
add support for objects to the imperative paradigm.
Textbooks
We will use two textbooks in this course plus some selected readings:
The Little Schemer - 4th Edition
by Daniel P. Friedman and Matthias Felleisen
Publisher: The MIT Press; 4 edition (December 21, 1995)
The notion that "thinking about computing is one of the most exciting things the human mind can
do" sets both The Little Schemer (formerly known as The Little LISPer) and its new companion
volume, The Seasoned Schemer, apart from other books on LISP. The authors'
enthusiasm for their subject is compelling as they present abstract concepts in a
humorous and easy-to-grasp fashion. Together, these books will open new doors of
thought to anyone who wants to find out what computing is really about.
The Little Schemer introduces computing as an extension of arithmetic and algebra --
things that everyone studies in grade school and high school. It introduces programs
as recursive functions and briefly discusses the limits of what computers can do. The
authors use the programming language Scheme, and interesting foods to illustrate these
abstract ideas. The Seasoned Schemer informs the reader about additional dimensions of
computing: functions as values, change of state, and exceptional cases.
The Little LISPer has been a popular introduction to LISP for many years.
It had appeared in French and Japanese. The Little Schemer and The Seasoned Schemer
are worthy successors and will prove equally popular as textbooks for Scheme courses
as well as companion texts for any complete introductory course in Computer Science.
Scheme and the Art of Programming by George Springer and Daniel
P. Friedman (MIT Press, 1989). You may purchase a copy of this at
the UNM Copy Center which is located in Dane Smith Hall.
Godel, Escher, Bach: An Eternal Golden Braid by Douglas R. Hofstadter.
A Pulitzer Prize winning, metaphorical Fugue on Minds and Machines in the spirit of Lewis Carroll.Class Notes
tree.scm Implementation of a tree data structure and a depth-first traversal of the tree. [updated 5/12]
Sample Questions of the type to be expected on the final exam. [added 5/11]On-line Documentation:
Scheme Implementation
This course uses the open source Scheme implementation
MzScheme (pronounced "Ms. Scheme").
MzScheme is mostly R5RS-compliant, and provides several notable extensions.
The download site contains documentation and executables for Linux, Windows, and Mac.
The Linux version is installed in the CS lab in FEC 307, and can be
found under Apps -> Programming -> MzScheme.
Grading
Attendance
Your attendance at lectures and recitation section meetings is
mandatory. Attendance will be taken in
recitation. If you miss more than three recitation section
meetings, then you will be given a failing grade (F) for the course.
Due to the large class size, it is
not practical to take attendance at each
lecture. However, quizzes will be in-class and
unannounced. There are no make-up quizzes regardless of the
reason for missing class. If you have a major automobile accident, it may not
be your fault, but you should expect that it will interfere with your education
(it may also interfere with your ability to walk and breath).
There will be 10 to 20 quizzes, so missing one will impact your grade by
at most 2 percent, and probably closer to 1%.
This great tune by Bob Kanefsky was bequeathed to me in its mp3 form by my friend and
colleague Lance Williams:
God Wrote In Lisp (mp3).