Week 10

  • Last week:
    • Peter Welch's Occam-pi Lecture Notes
    • Go demo and starter code: see last week's notes for details
    • Demo and codewalk of csp-dining-philosophers.go

  • Demo and codewalk: Sieve of Eratosthenes (Prime Number Sieve) sieve.go
    • Go language features highlighted:
      • Only one looping construct in Go: for loop
        • all three parts are optional: init statement, conditional expression, post statement
      • channel declarations in function headers
        • can specify syntactically whether channel is for reading from:
          <-chan

          or writing to:

          chan<-
    • To run this program:
      $ go run sieve.go
    • Monitor the running program:
      • use top command for system info while running
      • run lscpu to remind us about system resources
      • how many processes (goroutines) are running concurrently (if not in parallel)?
        • use wc -l and watch to monitor
  • Assignment 5 posted
    • Sort Pump Gophers PDF
    • see a similar example in occam on slides 13–31 of PHW&#039;s replicators lecture notes which can be found here
    • be sure to read the advice section of the assignment description closely—I tried to document most of the Golang learning curve questions I encountered in the hopes of helping you!
    • Due: Tue, April 14th

  • History
    • proposed by David Gelernter Wikipedia
      • while a PhD student at SUNY Stoneybrook
      • now a professor at Yale
      • overcome a great deal personally!
    • origins of name
      • off-color humor
    • implementations
      • C-Linda (Martin Schultz and David Gelernter)
      • Ruby implementation no less off-color!
    • communications decoupled in 3 dimensions:
      • time
      • space
      • destination
  • Lecture Notes: PDF
  • Demo of Ruby/Rinda program