What is go
about?
Szymon Sobczak
getbase.com: the post-PC CRM
composition
&
CONCURRENcy
composition
no classes - define methods on structure:
type Cat struct {}
func (c Cat) Purr() {}
no classes - define methods on structure:
type Cat struct {}
func (c Cat) Purr() {}
COMPOSITION
no classes - define methods on structure:
type Cat struct {}
func (c Cat) Purr() {}
no subtypes:
type Kitty { Cat }
// func (k Kitty) Purr() { return k.Cat.Purr() }
no classes - define methods on structure:
type Cat struct {}
func (c Cat) Purr() {}
no subtypes:
type Kitty { Cat }
// func (k Kitty) Purr() { return k.Cat.Purr() }
COMPOSITION
no classes - define methods on structure:
type Cat struct {}
func (c Cat) Purr() {}
no subtypes:
type Kitty { Cat }
// func (k Kitty) Purr() { return k.Cat.Purr() }
interfaces satisfied implicitly:
type Purrator Interface { Purr() }
no classes - define methods on structure:
type Cat struct {}
func (c Cat) Purr() {}
no subtypes:
type Kitty { Cat }
// func (k Kitty) Purr() { return k.Cat.Purr() }
interfaces satisfied implicitly:
type Purrator Interface { Purr() }
COMPOSITION:
simple pieces
connected by
small interfaces
concurrency
-
lightweight threads
- typed, thread safe communication
Don't communicate by sharing memory;
share memory by communicating.
share memory by communicating.
let's use it!
timeline
0 -> msg
0 - 10 -> prepare
10 - 30 -> select
30 - 40 -> prepare
40 - 60 -> select
60 - 70 -> prepare
70 - 90 -> select
90 - 100 -> prepare
coach has (+20ms) till send
100 -> ball shows up on the table
Go is about
composition and concurrency
give it a try
if you need those
thank you
Szymon Sobczak
getbase.com: the post-PC CRM
Why go?
By Szymon Sobczak
Why go?
- 1,024