3. Big names!
Robert C Pike Plan 9
Kenneth Thompson Unix
Robert Griesemer V8, HotSpot
etc... Plan 9, GCC, etc...
4. Overviews
• Launched by Google
• R.I.P Noop?
• System Programming
• Server side?
• Frustration with existing languages
• Implement some useful ideas
7. Interface
• Duck typing
• Method set
• Not Java like interface
• Flexible!
• Add method to struct
8. e.g. Interface
// Apply this to any type implementing Sortable
func Sort(data Sortable)
{
for i := 1; i < data.Len(); i++ {
for j := i; j > 0 && data.Less(j, j-1); j-- {
data.Swap(j, j-1);
}
}
}
11. e.g. Goroutine
func main()
{
ch := make(chan int); // Create a new channel.
go generate(ch); // Start as a goroutine.
for {
// do something
// fmt.Print(<-ch);
}
}
12. e.g. Channel
// Send the sequence 2, 3, 4, ... to channel 'ch'.
func generate(ch chan int)
{
for i := 2; ; i++ {
ch <- i // Send 'i' to channel 'ch'.
}
}
13. Others
• Garbage Collected
• M&S, IBM’s Recycler in the future
• Windows support
• Patch welcome! but...
• Multiple values
• etc...