Go Language Homework: To install Go on Mac (my way): Open terminal and run this to get Homebrew, the best Mac package manager: ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" Then type: brew update   To get new formula definitions.  Follow that with: brew install go After a couple seconds you should have Go installed on your machine.  If you don’t like package managers or have one you prefer to use, figure it out for yourself.   A brief introduction to the Go language! Variable Syntax: Go is a semi-dynamically typed language, that means that if you want to make an integer named id both of the following work: id int id := 0 Structs work much like C++: type Philosopher struct { id int chopstick chan bool neighbor *Philosopher } Arrays on the other hand are created using the make function.  To make an array of Philosopher pointers with n elements, the syntax would be: n := 5 phils := make([]*Philosopher, n) You might notice two things about this struct, first there’s the word ‘chan’ in front of that boolean and the second is that ‘type’ goes before the word Philosopher and ‘struct’ goes after it.  The ‘chan’ means that that variable is shared on a channel.  The philosophy of the Go language is “Do not communicate by sharing memory; instead, share memory by communicating.”  Channels are the parts that get communicated during Go routines.  Go routines have simple syntax: //Makes an array of Philosopher pointer channels. announce := make(chan *Philosopher) for _, phil := range philosophers { go { phil.dine(announce) } } This little bit of code does something quite elegantly, the for loop is the syntax roughly equivalent to the “for word in line” so often used in Python programs.  But the cool part about this snippet is the keyword “go” in front of the function call which is, in essence saying: “Hey, go ahead and open threads for this iterative task and run this function in each thread.”  Pretty neat right? To compile a Go program create a program hierarchy like this: DiningPhilosophers/go/src/DiningPhilosopers/dining_philosophers.go Then after writing your program as dining_philosophers.go you’re going to want to compile and run it.  So type “go build” and an executable should appear in the lowest directory.  If for some reason it doesn’t, try running “go fix” to see if the Go compiler can automatically fix your code. Now I’m going to give you some sample code blocks and ask you to put them together to make our favourite parallel problem, The Dining Philosophers. Alternatively try re-implementing whatever code you want in Go and see the speed/development time advantages.