Held Wednesday, September 4, 2002
Today we begin our investigations of the core language for the course,
Scheme. Scheme is a simple functional language with many imperative
features and very little syntax.
- I finally got to reading your introductory surveys. Thanks
for spending so much time on them. Here are some answers to questions
- Tell me about your educational background. I have a
bachelor's degree in Math from the University of Chicago and
both a Master's and a Ph.D. in Computer Science from Chicago.
Before coming to Grinnell, I was a visiting professor at Dartmouth.
Oh, I went to Newton North High School in Newton, Massachusetts (as
did Pablo Silva).
- What do you consider a good student? One who tries hard
and participates actively in class.
- Can women succeed in CS? Although I agree that men and
women sometimes approach problems differently, my experience has
been that women can do as well or better than men in CS. The best
student I taught was a woman. I also think that CS needs more women,
in part because men and women do approach problems differently, and
the field benefits from different approaches.
- How old are your kids? William is 7 and in 2nd grade.
Jonathan is 4 and starting preschool. Daniel is 1 and starting to
figure out some words.
- What kinds of research do you do? Most of my research
these days involves the Web and hypermedia. One project involves
adding more interactivity to the Web (e.g., annotations) by
mediating the conversation between browser and server.
My students and I build tools that transform pages on the fly.
Another project involves building tools that let us analyze the ways
in which students use course webs to see if there are patterns that
successful students tend to use (and which we could therefore teach
to less successful students). Mostly, I look for projects that I think
(1) can have a real impact, (2) are at a level that Grinnell students
can contribute successfully, and (3) seem to be fun and interesting.
- We'll spend a few minutes talking about
- I'd like to make sure that each of you has a group.
- I've intentionally left the assignment relatively open.
- I'm in the process of updating the
reading on lists. I'd prefer if you
wait until after 3pm today or so to do that reading.
- Scheme basics
- Scheme is generally used in an interactive environment:
You type syntactically-valid expressions and Scheme returns
- As Holly (I think) mentioned and others seconded, it's beneficial
to be able to test stuff as you go.
- Later this semester, we'll see how to use Scheme in different
- Scheme's syntax is fairly simple: Since almost everything in
Scheme involves the application of a function to some arguments,
- an open parenthesis;
- the name of the procedure;
- a space;
- the parameters to the procedure (separated by spaces); and
- a close parenthesis.
- For example,
(+ 2 3 4)
(expt 2 3)
- If you remember this basic syntactic structure, you'll rarely get
syntactic errors from Scheme.
- Scheme is a variant of Lisp (the List processing language).
- Lisp is one of the oldest high-level programming languages in
- It's from about the time of the invention of Cobol and only a few
years after the invention of Fortran.
- John McCarthy (of MIT and then Stanford) designed Lisp to provide a
language for programming in artificial intelligence.
- At the time, many people believed that intelligence was grounded
in symbolic processing.
- Lisp added many things to languages of the day:
- Symbolic values
- Dynamic lists as built-in data structures
- Automatic memory managment for those built-in data structures
- Functions as values (we'll return to this in a few weeks)
- In later reflection, McCarthy indicated that some of these things
were just luck. For example, the
lambda that you'll
learn about soon was just a "hmmm ... that sounds interesting, I'll
put it in" fluke.
- Scheme was designed in the early 1980's (or maybe late 1970's) as
a variant of Lisp more appropriate for teaching computer science
(and doing many other things; it's more elegant).
- Scheme has a slightly clearer semantics than Lisp (and a formal
semantics, which is important).
- Scheme adds some nifty features for advanced programmers.
- But, at least for 151, you're doing Lisp-like programming.
+: Sum its parameters.
*: Compute the product of its parameters.
-: Subtract the second parameter from the first.
(sqrt val): Compute the square root of val.
(expt v p): Compute vp.
(abs v): Compute the absolute value of v.
- You'll need to figure out DrScheme before you can write any Scheme, so start
with The DrScheme Lab.
- After a little while of playing with DrScheme, you should be ready for the
Beginning Scheme lab.
- I hope to spend the last few minutes of class giving you a chance to reflect
on your first experiences with Scheme.
Thursday, 29 August 2002
Tuesday, 3 September 2002
- Added introductory notes.
- Updated a few lines in the description.
Friday, 6 September 2002
- Added short history of Scheme (taken from another outline), since
I talked about it in class anyway.