2. It includes a http-server
thats why it‘s a web-technology.
3. Moritz Haarmann
• GTUG/NA Founding Member
• Interests: Android, iPhone, Web and Open
Technologies
• 25y, writing my Bachelor Thesis
( CompScience ), HdM Stuttgart
• @derwildemomo
21. The Basics
• Compiled, no Bytecode/Interpreter
• Static Typing
• Concurrent, Functional, Imperative
Paradigms satisfied
• Clean design, familiar C-like Syntax
• Garbage Collector: its problem is not
yours.
33. Packages
• Form the core organizational unit
• one package - one file
• entry point: Package main with function
main
• Function visibility: First letter decides!
( func invisible() vs. func Visible() )
• many packages shipped for common tasks,
e.g. http
36. Sharing Memory
information a a information a
information information a
information a a information a
information information a
information a a information a
information information a
information a a information a
information information a
information a a information a
information information a
information a a information a
information information a
37. Sharing by
Communicating
information a information b
information b information b
information b information b
information b information a
information a information a
information a information a
38. Do not communicate by
sharing memory; instead, share
memory by communicating
44. Channels
• First-Class Value Object
• Typed, e.g. chan int is a channel transporting
ints.
• buffered, that is async, or unbuffered and
therefore synchronous channel
45. Channels
• First-Class Value Object
• Typed, e.g. chan int is a channel transporting
ints.
• buffered, that is async, or unbuffered and
therefore synchronous channel
• Brainfuck ( for now ): channels of channels!
46. Sorting in background
c := make(chan int)
go func() {
list.Sort()
c <- 1
}()
doSomethingForAWhile()
<-c
48. WTF?
• Goroutines and Channels hide the
complexity of threads, mutexes and other
hard-to-master stuff effectively
49. WTF?
• Goroutines and Channels hide the
complexity of threads, mutexes and other
hard-to-master stuff effectively
• Race conditions, deadlocks etc are
impossible.
50. WTF?
• Goroutines and Channels hide the
complexity of threads, mutexes and other
hard-to-master stuff effectively
• Race conditions, deadlocks etc are
impossible.
• Another underlying thought model
52. A word on types
• Known types are known ( int, unsigned )
53. A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
54. A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
55. A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
• Custom Types
56. A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
• Custom Types
• Arrays++: Slices
57. A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
• Custom Types
• Arrays++: Slices
• Pointers but no arithmetic ( guess why )
59. Slices
• Type- and Boundsafe Array Wrappers, that
can be easily generated and passed around
60. Slices
• Type- and Boundsafe Array Wrappers, that
can be easily generated and passed around
• Reference to underlying data
61. Slices
• Type- and Boundsafe Array Wrappers, that
can be easily generated and passed around
• Reference to underlying data
• Safe, fast and easy to use