Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Roots of Go

The Roots of Go

Every once in a while, a new programming language comes up that fundamentally changes how we think about computing. But even more so often, the core ideas behind a “new” language are hinged upon ideas that were first propounded by languages or systems which are much older.

Often our understanding of a language’s features and the intentions thereof are limited by our understanding of its roots.

In this talk, BG will talk about the origins of the core ideas behind Go and will take you on a “language-archeology” tour where we’ll trace the roots of Go.

8aa4490274249db8981283bdadb2ec2b?s=128

Baishampayan Ghose

July 08, 2015
Tweet

Transcript

  1. The Roots of Go Baishampayan "BG" Ghose Helpshift, Inc. @ghoseb

    GopherCon 2015 // Denver, CO 1
  2. Or, How our past holds the key to the future.

    GopherCon 2015 // Denver, CO 2
  3. Motivation — Should I really care? — Yes, you should.

    GopherCon 2015 // Denver, CO 3
  4. And now, for something completely different... GopherCon 2015 // Denver,

    CO 4
  5. How we design software — We need to build a

    doghouse — 3x3x3 foot GopherCon 2015 // Denver, CO 5
  6. How we design software (contd.) — We succeeded. Oops! —

    Now let's scale this solution — 100x100x100 foot — Should be easy! GopherCon 2015 // Denver, CO 6
  7. How we design software (contd.) — What we get instead

    is something else — Physics. Obey! GopherCon 2015 // Denver, CO 7
  8. How we design software (contd.) — It's a feature! —

    We're building Pyramids all along GopherCon 2015 // Denver, CO 8
  9. Rinse. Repeat. GopherCon 2015 // Denver, CO 9

  10. GopherCon 2015 // Denver, CO 10

  11. At scale, architecture dominates material. — Alan Kay GopherCon 2015

    // Denver, CO 11
  12. ar·chi·tec·ture n. the art or practice of designing structures GopherCon

    2015 // Denver, CO 12
  13. The Roots of Go GopherCon 2015 // Denver, CO 13

  14. The Arches of Go GopherCon 2015 // Denver, CO 14

  15. BCPL Martin Richards (1967) GopherCon 2015 // Denver, CO 15

  16. BCPL GET "libhdr" LET start() = VALOF $( writes("Hello, world!*n")

    RESULTIS 0 // ret $) GopherCon 2015 // Denver, CO 16
  17. Modula-2 Niklaus Wirth (1977) GopherCon 2015 // Denver, CO 17

  18. Modula-2 MODULE ggTkgV; FROM InOut IMPORT ReadCard, WriteCard, WriteLn, WriteString,

    WriteBf; VAR x, y, u, v : CARDINAL; BEGIN WriteString ("x = "); WriteBf; ReadCard (x); WriteString ("y = "); WriteBf; ReadCard (y); u := x; v := y; WHILE x # y DO (* ggT (x, y) = ggT (x0, y0), x * v + y * u = 2 * x0 * y0 *) IF x > y THEN x := x - y; u := u + v ELSE y := y - x; v := v + u END END; WriteString ("ggT ="); WriteCard (x, 6); WriteLn; WriteString ("kgV ="); WriteCard ((u+v) DIV 2, 6); WriteLn; WriteString ("u ="); WriteCard (u, 6); WriteLn; WriteString ("v ="); WriteCard (v , 6); WriteLn END ggTkgV. GopherCon 2015 // Denver, CO 18
  19. Modula-3 Go's alien ancestor from Outer Space MODULE GCD EXPORTS

    Main; IMPORT IO, Fmt; PROCEDURE GCD(a, b: CARDINAL): CARDINAL = BEGIN IF a = 0 THEN RETURN b; ELSIF b = 0 THEN RETURN a; ELSIF a > b THEN RETURN GCD(b, a MOD b); ELSE RETURN GCD(a, b MOD a); END; END GCD; BEGIN IO.Put("GCD of 100, 5 is " & Fmt.Int(GCD(100, 5)) & "\n"); IO.Put("GCD of 5, 100 is " & Fmt.Int(GCD(5, 100)) & "\n"); IO.Put("GCD of 7, 23 is " & Fmt.Int(GCD(7, 23)) & "\n"); END GCD. GopherCon 2015 // Denver, CO 19
  20. CSP CAR Hoare (1978) GopherCon 2015 // Denver, CO 20

  21. Aside: Concurrent Prime Sieve Douglas McIlroy (1968) GopherCon 2015 //

    Denver, CO 21
  22. CSP Sieve [SIEVE(i:1..100):: p,mp:integer; SIEVE(i - 1)?p; print!p; mp :=

    p; comment mp is a multiple of p; *[m:integer; SIEVE(i - 1)?m ? *[m > mp ? mp := mp + p]; [m = mp ? skip ||m < mp ? SIEVE(i + 1)!m ] ] ||SIEVE(0)::print!2; n:integer; n := 3; *[n < 10000 ? SIEVE(1)!n; n := n + 2] ||SIEVE(101)::*[n:integer;SIEVE(100)?n ? print!n] ||print::*[(i:0..101) n:integer; SIEVE(i)?n ? ...] ] GopherCon 2015 // Denver, CO 22
  23. Newsqueak Rob Pike (1988) GopherCon 2015 // Denver, CO 23

  24. Newsqueak counter:=prog(end: int, c: chan of int) { i:int; for(i=2;

    i<end; i++) c<-=i; }; filter:=prog(prime: int, listen: chan of int, send: chan of int) { i:int; for(;;) if((i=<-listen)%prime) send<-=i; }; GopherCon 2015 // Denver, CO 24
  25. Newsqueak sieve:=prog(c: chan of int) { for(;;){ prime:=<-c; print(prime, "

    "); newc:=mk(chan of int); begin filter(prime, c, newc); c=newc; } }; count:=mk(chan of int); begin counter(10000, count); begin sieve(count); ""; GopherCon 2015 // Denver, CO 25
  26. Smalltalk Alan Kay, et al (1976) GopherCon 2015 // Denver,

    CO 26
  27. C, Pascal, & APL Syntax, Semantics & Pragmatics GopherCon 2015

    // Denver, CO 27
  28. Go Geneology GopherCon 2015 // Denver, CO 28

  29. Doing less of the wrong things allows us to do

    more of the right things. — Anonymous Coward GopherCon 2015 // Denver, CO 29
  30. Less is exponentially more. — Rob Pike GopherCon 2015 //

    Denver, CO 30
  31. Thanks Go forth, and build good software! GopherCon 2015 //

    Denver, CO 31