X-Git-Url: http://lambda.jimpryor.net/git/gitweb.cgi?p=lambda.git;a=blobdiff_plain;f=week1.mdwn;h=5ea3f421e69234c88e0fd974a486ad61e580fae0;hp=21c918098c3d83d1c7f1e981d1324839a5f2f26e;hb=2d0d8e91618b921c03f4764bc7937060f0bec739;hpb=4675d2cd19a3e4f069cfdd009ca07281ab424b1d diff --git a/week1.mdwn b/week1.mdwn index 21c91809..5ea3f421 100644 --- a/week1.mdwn +++ b/week1.mdwn @@ -10,13 +10,7 @@ Sometimes these notes will expand on things mentioned only briefly in class, or Basics of Lambda Calculus ========================= -See also: - -* [Chris Barker's Lambda Tutorial](http://homepages.nyu.edu/~cb125/Lambda) -* [Lambda Animator](http://thyer.name/lambda-animator/) -* MORE - -The lambda calculus we'll be focusing on for the first part of the course has no types. (Some prefer to say it instead has a single type---but if you say that, you have to say that functions from this type to this type also belong to this type. Which is weird.) +The lambda calculus we'll be focusing on for the first part of the course has no types. (Some prefer to say it instead has a single type---but if you say that, you have to say that functions from this type to this type also belong to this type. Which is weird... In fact, though, such types are studied, under the name "recursive type." More about these later in the seminar.) Here is its syntax: @@ -36,7 +30,6 @@ We'll tend to write `(λa M)` as just `(\a M)`, so we don't hav Application: `(M N)` -Some authors reserve the term "term" for just variables and abstracts. We'll probably just say "term" and "expression" indiscriminately for expressions of any of these three forms. Examples of expressions: @@ -78,6 +71,10 @@ For instance: The first occurrence of `x` in T is free. The `\x` we won't regard as containing an occurrence of `x`. The next occurrence of `x` occurs within a form that begins with `\x`, so it is bound as well. The occurrence of `y` is bound; and the occurrence of `z` is free. +To read further: + +* [[!wikipedia Free variables and bound variables]] + Here's an example of beta-reduction: ((\x (y x)) z) @@ -126,7 +123,7 @@ because here the second occurrence of `y` is no longer free. There is plenty of discussion of this, and the fine points of how substitution works, in Hankin and in various of the tutorials we've linked to about the lambda calculus. We expect you have a good intuitive understanding of what to do already, though, even if you're not able to articulate it rigorously. -* MORE +* [More discussion in week 2 notes](/week2/#index1h1) Shorthand @@ -308,7 +305,7 @@ Finally, you'll see the term **dynamic** used in a variety of ways in the litera * dynamic versus static typing -* dynamic versus lexical scoping +* dynamic versus lexical [[!wikipedia Scope (programming) desc="scoping"]] * dynamic versus static control operators @@ -316,6 +313,16 @@ Finally, you'll see the term **dynamic** used in a variety of ways in the litera For the most part, these uses are only loosely connected to each other. We'll tend to use "imperatival" to describe the kinds of semantic properties made available in dynamic semantics, languages which have robust notions of sequencing changes, and so on. +To read further about the relation between declarative or functional programming, on the one hand, and imperatival programming on the other, you can begin here: + +* [[!wikipedia Declarative programming]] +* [[!wikipedia Functional programming]] +* [[!wikipedia Purely functional]] +* [[!wikipedia Referential transparency (computer science)]] +* [[!wikipedia Imperative programming]] +* [[!wikipedia Side effect (computer science) desc="Side effects"]] + + Map === @@ -323,7 +330,7 @@ Map Scheme (functional part) OCaml (functional part) -C, Java, Pasval
+C, Java, Python
Scheme (imperative part)
OCaml (imperative part) @@ -342,17 +349,15 @@ combinatorial logic + Rosetta Stone ============= Here's how it looks to say the same thing in various of these languages. -The following site may be useful; it lets you run a Scheme interpreter inside your web browser: - -
-