Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Fundamentals of Computing

602 views

Published on

Digital Science Cambridge Retreat 2014 slides about "Fundamentals of Computing".

Published in: Software
  • Be the first to comment

  • Be the first to like this

Fundamentals of Computing

  1. 1. http://wedesoft.de/downloads/cambridge2014.pdf Fundamentals of Computing 1/18c 2014 Jan Wedekind, Digital Science
  2. 2. http://wedesoft.de/downloads/cambridge2014.pdf motivation The Hundred-Year Language 2/18c 2014 Jan Wedekind, Digital Science Paul Graham
  3. 3. http://wedesoft.de/downloads/cambridge2014.pdf motivation not fundamentals of computing 3/18c 2014 Jan Wedekind, Digital Science
  4. 4. http://wedesoft.de/downloads/cambridge2014.pdf motivation Building Your Own Dynamic Language 4/18c 2014 Jan Wedekind, Digital Science Ian Piumarta http://piumarta.com/papers/EE380-2007-slides.pdf
  5. 5. http://wedesoft.de/downloads/cambridge2014.pdf motivation Building Your Own Dynamic Language 5/18c 2014 Jan Wedekind, Digital Science Application System Hardware Libraries Compiler Syntax SemanticsSource Runtime Language Environment malleable (under programmer control) rigid (imposed fromoutside) "black box" (hermetically sealed) Pragmatics UDP
  6. 6. http://wedesoft.de/downloads/cambridge2014.pdf λ-calculus core 6/18c 2014 Jan Wedekind, Digital Science x, y, z, . . . ∈ L M ∈ L ⇒ λx.M ∈ L M, N ∈ L ⇒ (MN) ∈ L recursive definition x, y, z lambda { |x| M } M.call(N) Ruby x y z (lambda (x) M) (M N) Scheme abbreviations: • λab.M ≡ λa.λb.M • MNO . . . = ((. . . (MN)O) . . .)
  7. 7. http://wedesoft.de/downloads/cambridge2014.pdf λ-calculus Church encoding 7/18c 2014 Jan Wedekind, Digital Science id ≡ λx.x true ≡ λa.λb.a nil ≡ false ≡ λa.λb.b if1 ≡ λabc.abc and ≡ λmn.mnm or ≡ λmn.mmn not ≡ λm.λab.mba =bool ≡ λab.ab(not b) 1lazy evaluation pair ≡ λhtx.(if xht) head ≡ λl.(l true) tail ≡ λl.(l false) empty ≡ λl.(l (λhtb.false) true)
  8. 8. http://wedesoft.de/downloads/cambridge2014.pdf λ-calculus binary numbers 8/18c 2014 Jan Wedekind, Digital Science 0 ≡ nil 1 ≡ (pair true nil) 2 ≡ (pair true (pair false nil)) 3 ≡ (pair true (pair true nil)) ...
  9. 9. http://wedesoft.de/downloads/cambridge2014.pdf Scheme variable definitions ⇔ λ-expressions 9/18c 2014 Jan Wedekind, Digital Science Scheme uses eager evaluation ((lambda (f) ((lambda (x y) (f x y)) 2 3)) (lambda (a b) (+ a b))) ; 5 (let ((f (lambda (a b) (+ a b))) (x 2) (y 3)) (f x y)) ; 5 ; (define f (lambda (a b) (+ a b))) (define (f a b) (+ a b)) (define x 2) (define y 3) (f x y) ; 5
  10. 10. http://wedesoft.de/downloads/cambridge2014.pdf Scheme recursion ⇔ higher-order function 10/18c 2014 Jan Wedekind, Digital Science (define (neg l) (if (null? l) ’() (cons (- (car l)) (neg (cdr l))))) (neg (list 1 2 3)) ; (-1 -2 -3) (sum (list 1 2 3)) (define (sum l) (if (null? l) 0 (+ (car l) (sum (cdr l))))) (sum (list 1 2 3)) ; 6 (use-modules (srfi srfi-1)) (map - (list 1 2 3)) ; (-1 -2 -3) (fold + 0 (list 1 2 3)) ; 6
  11. 11. http://wedesoft.de/downloads/cambridge2014.pdf Scheme currying 11/18c 2014 Jan Wedekind, Digital Science (use-modules (srfi srfi-1)) (use-modules (srfi srfi-26)) (map (cut + <> 1) (list 1 2 3)) ; 2 3 4
  12. 12. http://wedesoft.de/downloads/cambridge2014.pdf Scheme quote, eval & apply 12/18c 2014 Jan Wedekind, Digital Science (quote +) ; + (quote (+ 1 2)) ; (+ 1 2) (car (quote (+ 1 2))) ; + (eval (quote (+ 1 2)) (current-module)) ; 3 (eval (car (quote (+ 1 2))) (current-module)) ; #<procedure + (#:optional _ _ . _)> (apply + (list 1 2)) ; 3
  13. 13. http://wedesoft.de/downloads/cambridge2014.pdf Scheme (hygienic) macros ⇔ lazy evaluation 13/18c 2014 Jan Wedekind, Digital Science (define-syntax-rule (lazy expr) (lambda () expr)) (define-syntax-rule (force expr) (expr)) (define y (let ((x 2)) (lazy (+ x 3)))) y ; #<procedure 105992de0 at <current input>:10:0 ()> (force y) ; 5
  14. 14. http://wedesoft.de/downloads/cambridge2014.pdf 14/18c 2014 Jan Wedekind, Digital Science closures, monads, prompts, delimited continuations, combinators, reification, multiple dispatch, generics using functions, Y-combinator, Iota & Jot, reflection, inspection, readers, Factor, Haskell
  15. 15. http://wedesoft.de/downloads/cambridge2014.pdf More References Binary Lambda Calculus 15/18c 2014 Jan Wedekind, Digital Science John Tromp
  16. 16. http://wedesoft.de/downloads/cambridge2014.pdf More References Structure and Interpretation of Computer Programs 16/18c 2014 Jan Wedekind, Digital Science Harold Abelson & Gerald Sussman
  17. 17. http://wedesoft.de/downloads/cambridge2014.pdf More References Understanding Computation 17/18c 2014 Jan Wedekind, Digital Science Tom Stuart
  18. 18. http://wedesoft.de/downloads/cambridge2014.pdf More References Schemer books 18/18c 2014 Jan Wedekind, Digital Science The    Little Seasoned Reasoned    Schemer: Q&A-style books

×