50d1c03b54aacfdf4d14880e95b852c5c2842333
[lambda.git] / index.mdwn
1 # Seminar in Semantics / Philosophy of Language #
2
3 or: **What Philosophers and Linguists Can Learn From Theoretical Computer Science But Didn't Know To Ask**
4
5 This course is co-taught by [Chris Barker](http://homepages.nyu.edu/~cb125/) and [Jim Pryor](http://www.jimpryor.net/). Linguistics calls it "LING-GA 3340" and Philosophy calls it "PHIL-GA 2296".
6 The seminar meets in spring 2015 on Thursdays from 4 until a bit before 7 (with a short break in the middle), in
7 the Linguistics building at 10 Washington Place, in room 103 (front of the first floor).
8
9 <!--
10 One student session will be held every Wednesday from XX-YY at WHERE.
11 -->
12
13
14 ## Announcements ##
15
16 This wiki will be undergoing lots of changes throughout the semester, and particularly in these first few days as we get it set up, migrate over some of the content from the previous time
17 we taught this course, and iron out various technical wrinkles. Please be patient. When you sit down to read the wiki, it's a good idea to always hit "Refresh" in your browser to make sure you're reading the latest additions and refinements of the website. (Sometimes these will be tweaks, other times very substantial. Updates will happen at miscellaneous hours, sometimes many times in a given day.)
18
19 If you've eager to learn, though, you don't have to wait on us to be ready to serve you. You can go look at the [archived first version](http://lambda1.jimpryor.net) of this course. Just keep in mind that
20 the text and links there haven't been updated. And/or you can get started on installing the software and ordering some of the books.
21
22 As we mentioned in class, if you're following the course and would like to be emailed occasionally, send an email to <mailto:jim.pryor@nyu.edu>, saying "lambda" in the subject line. Most often, we will just post announcements to this website, rather than emailing you. But occasionally an email might be more appropriate.
23
24 As we mentioned in class, we're also going to schedule a session to discuss the weekly homeworks. If you'd like to participate in this, please complete [this Doodle poll](http://doodle.com/7xrf4w8xq4i9e5za). It asks when you are available on Tuesdays and Wednesdays.
25
26 <!--
27 One student session will be held every Wednesday from XX-YY at WHERE.
28
29 For those who'd like to attend the section but can't make the
30 Wednesday time: If you're one of the students who
31 wants to meet for Q&A at some other time in the week, let us know.
32
33 You should see the student sessions as opportunities to clear up lingering
34 issues from material we've discussed, and help get a better footing for what
35 we'll be doing the next week. It would be smart to make a serious start on that
36 week's homework, for instance, before the session.
37 -->
38
39 Here is information about [[How to get the programming languages running on your computer]].
40
41 Here are Lecture notes for [[Week1]]; [[Assignment1]]. (*These will be posted soon.*)
42
43 >       Topics: Basics of Functional Programming
44
45 <!--
46 *       Henceforth, unless we say otherwise, every homework will be "due" by
47 Wednesday morning after the Thursday seminar in which we refer to it.
48 (Usually we'll post the assignment shortly before the seminar, but don't
49 rely on this.) However, for every assignment there will be a "grace
50 period" of one further week for you to continue working on it if you
51 have trouble and aren't able to complete the assignment to your
52 satisfaction by the due date. You shouldn't hesitate to talk to us---or
53 each other!---about the assignments when you do have trouble. We don't
54 mind so much if you come across answers to the assignment when browsing
55 the web, or the Little Schemer book, or anywhere. So long as you can
56 reason yourself through the solutions and experience for yourself the
57 insights they embody.
58
59         We reserve the privilege to ruthlessly require you to
60 explain your solutions in conversations at any point, in section or in
61 class.
62
63         You should always *aim* to complete the assignments by the "due" date,
64 as this will fit best with the progress of the seminar.
65
66         The assignments will tend to be quite challenging. Again, you should by
67 all means talk amongst yourselves, and to us, about strategies and
68 questions that come up when working through them.
69
70         We will not always be able to predict accurately which problems are
71 easy and which are hard.  If we misjudge, and choose a problem that is
72 too hard for you to complete to your own satisfaction, it is still
73 very much worthwhile (and very much appreciated) if you would explain
74 what is difficult, what you tried, why what you tried didn't work, and
75 what you think you need in order to solve the problem.
76 -->
77
78
79 ## Course Overview ##
80
81 The overarching goal of this seminar is to introduce concepts and techniques from
82 theoretical computer science and show how they can provide insight
83 into established philosophical and linguistic problems.
84
85 This is not a seminar about any particular technology or software.
86
87 Rather, it's about a variety of conceptual/logical ideas that have been
88 developed in computer science and that linguists and philosophers ought to
89 know, or may already be unknowingly trying to reinvent.
90
91 Philosphers and linguists tend to reuse the same familiar tools in
92 ever more (sometime spectacularly) creative ways.  But when your only
93 hammer is classical logic, every problem looks like modus ponens.  In
94 contrast, computer scientists have invested considerable ingenuity in
95 studying the design of their conceptual tools (among other things), and they've made much progress that we can benefit from.
96
97 "Why shouldn't I reinvent some idea X for myself? It's intellectually
98 rewarding!" Yes it is, but it also takes time you might have better
99 spent elsewhere. After all, you can get anywhere you want to go by walking, but you can
100 accomplish more with a combination of walking and strategic subway
101 rides.
102
103 More importantly, the idiosyncrasies of your particular
104 implementation may obscure what's fundamental to the idea you're
105 working with. Your implementation may be buggy in corner cases you
106 didn't think of; it may be incomplete and not trivial to generalize; its
107 connection to existing literature and neighboring issues may go
108 unnoticed. For all these reasons you're better off understanding the
109 state of the art.
110
111 The theoretical tools we'll be introducing aren't part of the diet of most
112 everyday programmers, but they are prominent in academic computer science,
113 especially in the fields of functional programming and type theory.
114
115 Of necessity, this course will lay a lot of logical groundwork. But throughout
116 we'll be aiming to mix that groundwork with real cases
117 in our home subjects where these tools can (or already do, covertly) play central roles.
118
119 Our aim for the
120 course is to enable you to make these tools your own; to have enough
121 understanding of them to recognize them in use, use them yourself at least
122 in simple ways, and to be able to read more about them when appropriate.
123
124 [[More about the topics and larger themes of the course]]
125
126
127 ## Who Can Participate? ##
128
129 The course will not presume previous experience with programming.  We
130 will, however, discuss concepts embodied in specific programming
131 languages, and we will encourage experimentation with running,
132 modifying, and writing computer programs.
133
134 The course will not presume lots of mathematical or logical background, either.
135 However, it will demand a certain amount of comfort working with such material; as a result,
136 it will not be especially well-suited to be a first graduate-level course
137 in formal semantics or philosophy of language. If you have concerns about your
138 background, come discuss them with us.
139
140 If you hope to have the class satisfy the logic requirement for Philosophy PhD students, this needs to be discussed with us and approved in advance. If this would be
141 your first or only serious
142 engagement with graduate-level formal work you should consider
143 carefully, and must discuss with us, (1) whether you'll be adequately
144 prepared for this course, and (2) whether you'd be better served by
145 taking a logic course
146 with a more canonical syllabus.
147 This term you could take PHIL-GA 1003, [Logic for Philosophers](http://jdh.hamkins.org), offered by Joel Hamkins on Wednesdays 12-2.
148
149 Faculty and students from outside of NYU Linguistics and Philosophy are welcome
150 to audit, to the extent that this coheres well with the needs of our local
151 students.
152
153
154 ## Recommended Software ##
155
156 During the course, we'll be encouraging you to try out various things in Scheme
157 and OCaml. Occasionally we will also make remarks about Haskell. All three of these
158 are prominent *functional programming languages*. The term "functional" here means they have
159 a special concern with functions, not just that they aren't broken. But what precisely is
160 meant by "functional" is somewhat fuzzy and even its various precisifications take some
161 time to explain. We'll get clearer on this during the course. Another term used roughly the same as "functional"
162 is "declarative." At a first pass, "functional" or "declarative" programming is primarily focused on complex
163 expressions that get computationally evaluated to some (usually simpler) result. In class I gave the examples
164 of `1+2` (which gets evaluated in arithmetic to 3), `1+2 < 5` (which gets evaluated in arithmetic to 'true), and `1`
165 (which gets evaluated in arithmetic to 1). Also Google search strings, which get evaluated by Google servers to a
166 list of links.
167
168 The dominant contrasting class of programming languages (the great majority of what's used
169 in industry) are called "imperatival" languages, meaning they have more to do with following a sequence of commands (what we
170 called in class "side-effects", though sometimes what they're *alongside* is not that interesting, and all the focus is instead
171 on the effect). Programming languages like C and Python and JavaScript and so on are all of this sort.
172
173 In fact, nothing that gets marketed as a "programming language" is really completely 100% functional/declarative, and even the
174 imperatival languages will have purely functional fragments (they evaluate `1+2` to 3, also). So these labels are really
175 more about *styles* or *idioms* of programming, and languages like Scheme and OCaml and especially Haskell get called "functional languages" because
176 of the extent to which they emphasize, and are designed around those idioms. Even languages like Python and JavaScript are sometimes
177 described as "more functional" than some other languages. The language C is about as non-functional as you can get.
178
179 *       **Scheme** is one of two major dialects of *Lisp*, which is a large family
180 of programming languages. Scheme
181 is the more clean and minimalistic dialect, and is what's mostly used in
182 academic circles.
183 Scheme itself has umpteen different "implementations", which share most of
184 their fundamentals, but have slightly different extensions and interact with
185 the operating system differently. One major implementation is called Racket,
186 and that is what we recommend you use. If you're already using or comfortable with
187 another Scheme implementation, though, there's no compelling reason to switch.
188
189         Racket stands to Scheme in something like the relation Firefox stands to HTML.
190
191         (Wikipedia on [Lisp](http://en.wikipedia.org/wiki/Lisp_%28programming_language%29),
192 [Scheme](http://en.wikipedia.org/wiki/Scheme_%28programming_language%29),
193 and [Racket](http://en.wikipedia.org/wiki/Racket_%28programming_language%29).)
194
195 *       **Caml** is one of two major dialects of *ML*, which is another large
196 family of programming languages. Caml has only one active "implementation",
197 OCaml, developed by the INRIA academic group in France. Sometimes we may refer to Caml or ML
198 more generally; but you can assume that what we're talking about always works more
199 specifically in OCaml.
200
201         (Wikipedia on [ML](http://en.wikipedia.org/wiki/ML_%28programming_language%29),
202 [Caml](http://en.wikipedia.org/wiki/Caml),
203 and [OCaml](http://en.wikipedia.org/wiki/OCaml).)
204
205
206 *       Those of you with some programming background may have encountered a third
207 prominent functional programming language, **Haskell**. This is also used a
208 lot in the academic contexts we'll be working through. Its surface syntax
209 differs from Caml, and there are various important things one can do in
210 each of Haskell and Caml that one can't (or can't as easily) do in the
211 other. But these languages also have a lot in common, and if you're
212 familiar with one of them, it's not difficult to move between it and the
213 other.
214
215         (Wikipedia on [Haskell](http://en.wikipedia.org/wiki/Haskell_%28programming_language%29).)
216
217
218 <a name=installing></a>
219 [[How to get the programming languages running on your computer]]
220
221
222 ## Recommended Books ##
223
224 It's not *mandatory* to purchase these for the class. But they are good ways to get a more thorough and solid understanding of some of the more basic conceptual tools we'll be using. We especially recommend the first three of them.
225
226 *       *An Introduction to Lambda Calculi for Computer Scientists*, by Chris
227 Hankin, currently $18 paperback on
228 [Amazon](http://www.amazon.com/dp/0954300653).
229
230 *   *The Little Schemer, Fourth Edition*, by Daniel P. Friedman and Matthias
231 Felleisen, currently $29 paperback on [Amazon](http://www.amazon.com/exec/obidos/ASIN/0262560992).
232 This is a classic text introducing the gentle art of programming, using the
233 functional programming language Scheme. Many people love this book, but it has
234 an unusual dialog format that is not to everybody's taste. **Of particular
235 interest for this course** is the explanation of the Y combinator, available as
236 a free sample chapter [at the MIT Press web page for the
237 book](http://www.ccs.neu.edu/home/matthias/BTLS/).
238
239 *       *The Seasoned Schemer*, also by Daniel P. Friedman and Matthias Felleisen, currently $29 paperback
240 on [Amazon](http://www.amazon.com/Seasoned-Schemer-Daniel-P-Friedman/dp/026256100X). This is a sequel to The Little Schemer, and it focuses on mutation and continuations in Scheme. We will be covering those topics in the second half of the course.
241
242 *       *The Little MLer*, by Matthias Felleisen and Daniel P. Friedman, currently $31 paperback / $29 kindle
243 on [Amazon](http://www.amazon.com/Little-MLer-Matthias-Felleisen/dp/026256114X).
244 This covers much of the same introductory ground as The Little Schemer, but
245 this time in a dialect of ML. It doesn't use OCaml, the dialect we'll be working with, but instead another dialect of ML called SML. The syntactic differences between these languages is slight.
246 ([Here's a translation manual between them](http://www.mpi-sws.org/~rossberg/sml-vs-ocaml.html).)
247 Still, that does add an extra layer of interpretation, and you might as well just use The Little Schemer instead. Those of you who are already more comfortable with OCaml (or with Haskell) than with Scheme might consider working through this book instead of The Little Schemer; for the rest of you, or those of you who *want* practice with Scheme, go with The Little Schemer.
248
249 *       Another good book covering the same ground as the Hankin book, but
250 more thoroughly, and in a more mathematical style, is *Lambda-Calculus and Combinators:
251 an Introduction*, by J. Roger Hindley and Jonathan P. Seldin, currently $74 hardback / $65 kindle on [Amazon](http://www.amazon.com/dp/0521898854).
252 This book is substantial and though it doesn't presuppose any specific mathematical background knowledge, it will be a good choice only if you're already comfortable reading advanced math textbooks.
253 If you choose to read both the Hankin book and this book, you'll notice the authors made some different
254 terminological/notational choices. At first, this makes comprehension slightly slower,
255 but in the long run it's helpful because it makes the arbitrariness of those choices more salient.
256
257 *       Another good book, covering some of the same ground as the Hankin, and the Hindley &amp; Seldin, but delving deeper into typed lambda calculi, is *Types and Programming Languages*, by Benjamin Pierce, currently $77 hardback / $68 kindle on [Amazon](http://www.amazon.com/dp/0262162091). This book has many examples in OCaml.
258
259
260 ----
261
262 All wikis are supposed to have a [[SandBox]], so this one does too.
263
264 This wiki is powered by [[ikiwiki]].