Special Topics: Functional Languages I-II
Lecture 23
Table of Contents
Writing a research paper
Functional languages
Lambda calculus
https://www.cs.princeton.edu/~dpw/cos441-11/notes/slides13-lambda-calc.pdf
https://www.cs.princeton.edu/~dpw/cos441-11/notes/slides14-lambda-calc.pdf
https://gitlab.cecs.anu.edu.au/pages/2018-S1/courses/comp1100/lectures/lambda.pdf
https://www.cs.cmu.edu/~venkatg/teaching/15252-sp20/notes/lambda-calculus-slides.pdf
Hindley-Milner Type system
Scheme (a LISP dialiect)
http://www-formal.stanford.edu/jmc/history/lisp/node3.html
- https://see.stanford.edu/materials/icsppcs107/29-Introduction-To-Scheme.pdf
- https://see.stanford.edu/materials/icsppcs107/30-Scheme-Functions.pdf
- https://see.stanford.edu/materials/icsppcs107/31-Functions-As-Data.pdf
- https://see.stanford.edu/materials/icsppcs107/32-Scheme-Examples.pdf
https://mitp-content-server.mit.edu/books/content/sectbyfn/books_pres_0/6515/sicp.zip/index.html
From https://matt.might.net/articles/implementing-a-programming-language/:
; eval takes an expression and an environment to a value (define (eval e env) (cond ((symbol? e) (cadr (assq e env))) ((eq? (car e) 'λ) (cons e env)) (else (apply (eval (car e) env) (eval (cadr e) env))))) ; apply takes a function and an argument to a value (define (apply f x) (eval (cddr (car f)) (cons (list (cadr (car f)) x) (cdr f)))) ; read and parse stdin, then evaluate: (display (eval (read) '())) (newline) (eval '((λ x . x) (λ a . a)) '()) (eval '(λ x . x) '()) (eval '(((λ f . (λ x . (f x))) (λ a . a)) (λ b . b)) '()) (eval '((λ f . (f f)) (λ f . (f f))) '()) ; hmmmmm
notes
Compiling Closures
https://dl.acm.org/doi/10.1145/278283.278285
comparison to turing machines equivalent more "mathy", "programming languagey"
intuitive lambda calculus
defining common math/pl notions (numbers, booleans, operations on them, etc.)
operational semantics of lambda calculus, call-by-value vs. call-by-name
turing equivalence when would it not halt? what about iteration?