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.

Baishampayan Ghose

July 08, 2015
Tweet

More Decks by Baishampayan Ghose

Other Decks in Programming

Transcript

  1. Or, How our past holds the key to the future.

    GopherCon 2015 // Denver, CO 2
  2. How we design software — We need to build a

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

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

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

    We're building Pyramids all along GopherCon 2015 // Denver, CO 8
  6. BCPL GET "libhdr" LET start() = VALOF $( writes("Hello, world!*n")

    RESULTIS 0 // ret $) GopherCon 2015 // Denver, CO 16
  7. 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
  8. 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
  9. 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
  10. 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
  11. 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
  12. Doing less of the wrong things allows us to do

    more of the right things. — Anonymous Coward GopherCon 2015 // Denver, CO 29