SlideShare a Scribd company logo
Google Go
Web Technology Talks Meeting - 24.8.2010
          Moritz Haarmann
It includes a http-server
     thats why it‘s a web-technology.
Moritz Haarmann
• GTUG/NA Founding Member
• Interests: Android, iPhone, Web and Open
  Technologies
• 25y, writing my Bachelor Thesis
  ( CompScience ), HdM Stuttgart
• @derwildemomo
Thinks to talk about
Thinks to talk about
Why Google decided to go. ( Speculation )
Thinks to talk about
Why Google decided to go. ( Speculation )




Go Basics
Thinks to talk about
Why Google decided to go. ( Speculation )




Go Basics      Cool Ideas
Thinks to talk about
Why Google decided to go. ( Speculation )




                               Get you
Go Basics      Cool Ideas
                                going
Why Go?
C is still second-most used
   but almost 40 years old and notoriously unsafe
Java is not always an option
        read: System programming
Python etc. also rock
Same problem: Though they are cool, they cannot be
             applied to any problem
38 years after the
 invention of C
No real Alternative
Go
Go Basics
The Basics
The Basics
• Compiled, no Bytecode/Interpreter
The Basics
• Compiled, no Bytecode/Interpreter
• Static Typing
The Basics
• Compiled, no Bytecode/Interpreter
• Static Typing
• Concurrent, Functional, Imperative
  Paradigms satisfied
The Basics
• Compiled, no Bytecode/Interpreter
• Static Typing
• Concurrent, Functional, Imperative
  Paradigms satisfied
• Clean design, familiar C-like Syntax
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.
Always ask!
Hello World
package main

import "fmt"

func main() {
    fmt.Println("Hello, World")
}
Functions
with super-cow-powers.
Simple Function
  func simpleFunction() {
      (...)
  }

  func caller() {
      simpleFunction()
  }
Better Functions
Better Functions
func Function(an int) (int) {
    return an + 1
}
Better Functions
func Function(an int) (int) {
    return an + 1
}



func Function(an int) (returnValue int, another int)
{
    returnValue = an + in
    another = returnValue * 5
    return
}
Better Functions
func Function(an int) (int) {
    return an + 1
}



func Function(an int) (returnValue int, another int)
{
    returnValue = an + in
    another = returnValue * 5
    return
}
a,_ = Function(1)
Functionals

func execFunc(aFunc func()) {
    aFunc()
}
Functionals
func execFunc(aFunc func()) {
    aFunc()
    var anotherF = func(){
        fmt.Println("Thats another function")
    }
    execFunc(anotherF)
}
Packages
  in a short
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
Package Example
 package main

 import "fmt"

 func main() {
     fmt.Println("Hello, World")
 }
a parallel world
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
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
Do not communicate by
sharing memory; instead, share
  memory by communicating
Goroutines & Channels
Goroutine
func showGo() {
    go func(){
        time.Sleep(20)
        fmt.Println("parallel.")
    }
}
Channels
Channels
• First-Class Value Object
Channels
• First-Class Value Object
• Typed, e.g. chan int is a channel transporting
  ints.
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
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!
Sorting in background
      c := make(chan int)
      go func() {
          list.Sort()
          c <- 1
      }()
      doSomethingForAWhile()
      <-c
WTF?
WTF?

• Goroutines and Channels hide the
  complexity of threads, mutexes and other
  hard-to-master stuff effectively
WTF?

• Goroutines and Channels hide the
  complexity of threads, mutexes and other
  hard-to-master stuff effectively
• Race conditions, deadlocks etc are
  impossible.
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
A word on types
A word on types
• Known types are known ( int, unsigned )
A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
• Custom Types
A word on types
• Known types are known ( int, unsigned )
• First-Class UTF-8 Strings
• Arrays, Maps
• Custom Types
• Arrays++: Slices
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 )
Slices
Slices

• Type- and Boundsafe Array Wrappers, that
  can be easily generated and passed around
Slices

• Type- and Boundsafe Array Wrappers, that
  can be easily generated and passed around
• Reference to underlying data
Slices

• Type- and Boundsafe Array Wrappers, that
  can be easily generated and passed around
• Reference to underlying data
• Safe, fast and easy to use
Interfaces
Interfaces


• Duck Typing-Style
Interfaces


• Duck Typing-Style
• Quite Useful
A bit OO


• Functions operating on a type
...
type Momo struct {
    a int
    b int
}

func (m *Momo) wakeUp {
    m.shakeAlmostToDeath()
}

var m = new(Momo)
m.wakeUp()
Not discussed today
Not discussed today
• A lot
Not discussed today
• A lot
• Allocation, Memory Handling
Not discussed today
• A lot
• Allocation, Memory Handling
• Built-In gimmicks ( Do.once, init )
Not discussed today
• A lot
• Allocation, Memory Handling
• Built-In gimmicks ( Do.once, init )
• Error Handling
Not discussed today
• A lot
• Allocation, Memory Handling
• Built-In gimmicks ( Do.once, init )
• Error Handling
• The bitchy compiler
Not discussed today
• A lot
• Allocation, Memory Handling
• Built-In gimmicks ( Do.once, init )
• Error Handling
• The bitchy compiler
• Embedding
Questions?
http://tinyurl.com/gotalk2010
            und danke!

More Related Content

PPTX
Fundamentals of Python Programming
Kamal Acharya
 
PDF
Teach your kids how to program with Python and the Raspberry Pi
Juan Gomez
 
PDF
Python basics_ part1
Elaf A.Saeed
 
PDF
Python
prasad1ncc
 
PPTX
2016 bioinformatics i_python_part_1_wim_vancriekinge
Prof. Wim Van Criekinge
 
PPTX
Introduction to python
Ayshwarya Baburam
 
PPTX
2016 02 23_biological_databases_part2
Prof. Wim Van Criekinge
 
PPTX
Presentation on python
Venkat Projects
 
Fundamentals of Python Programming
Kamal Acharya
 
Teach your kids how to program with Python and the Raspberry Pi
Juan Gomez
 
Python basics_ part1
Elaf A.Saeed
 
Python
prasad1ncc
 
2016 bioinformatics i_python_part_1_wim_vancriekinge
Prof. Wim Van Criekinge
 
Introduction to python
Ayshwarya Baburam
 
2016 02 23_biological_databases_part2
Prof. Wim Van Criekinge
 
Presentation on python
Venkat Projects
 

What's hot (19)

PPTX
Introduction to Structure Programming with C++
Mohamed Essam
 
ODP
Introduction to programming with python
Porimol Chandro
 
PDF
What can Ruby learn from Python (and vice versa)?
Reuven Lerner
 
PPTX
Python Tutorial Part 1
Haitham El-Ghareeb
 
PPTX
Python basics
Jyoti shukla
 
ODP
Python Presentation
Narendra Sisodiya
 
PPTX
Class 27: Pythonic Objects
David Evans
 
PPTX
Basic Python Programming: Part 01 and Part 02
Fariz Darari
 
PDF
Python cheat-sheet
srinivasanr281952
 
PDF
Introduction to Programming in Go
Amr Hassan
 
PDF
Understand unicode & utf8 in perl (2)
Jerome Eteve
 
PDF
Intro to Python Workshop San Diego, CA (January 19, 2013)
Kendall
 
PDF
Zero to Hero - Introduction to Python3
Chariza Pladin
 
PDF
MMBJ Shanzhai Culture
MobileMonday Beijing
 
XLS
LoteríA Correcta
guest4dfcdf6
 
PDF
Jerry Shea Resume And Addendum 5 2 09
gshea11
 
PDF
Washington Practitioners Significant Changes To Rpc 1.5
Oregon Law Practice Management
 
PPTX
Paulo Freire Pedagpogia 1
Alejandra Perez
 
PPTX
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
Imsamad
 
Introduction to Structure Programming with C++
Mohamed Essam
 
Introduction to programming with python
Porimol Chandro
 
What can Ruby learn from Python (and vice versa)?
Reuven Lerner
 
Python Tutorial Part 1
Haitham El-Ghareeb
 
Python basics
Jyoti shukla
 
Python Presentation
Narendra Sisodiya
 
Class 27: Pythonic Objects
David Evans
 
Basic Python Programming: Part 01 and Part 02
Fariz Darari
 
Python cheat-sheet
srinivasanr281952
 
Introduction to Programming in Go
Amr Hassan
 
Understand unicode & utf8 in perl (2)
Jerome Eteve
 
Intro to Python Workshop San Diego, CA (January 19, 2013)
Kendall
 
Zero to Hero - Introduction to Python3
Chariza Pladin
 
MMBJ Shanzhai Culture
MobileMonday Beijing
 
LoteríA Correcta
guest4dfcdf6
 
Jerry Shea Resume And Addendum 5 2 09
gshea11
 
Washington Practitioners Significant Changes To Rpc 1.5
Oregon Law Practice Management
 
Paulo Freire Pedagpogia 1
Alejandra Perez
 
Majlis Persaraan Pn.Hjh.Normah bersama guru-guru Sesi Petang
Imsamad
 
Ad

Viewers also liked (8)

PDF
Facebook Scaling Overview
Moritz Haarmann
 
PDF
Use open source and rapid prototyping to put magic in magical products in IoT
Moe Tanabian
 
PPT
Marketing and Technology Go Hand-in Hand, But Where are They Going?
Mogul Marketing
 
PDF
Memory Management in Android
Opersys inc.
 
PDF
Simple Web Design Case Study (Website Design Process Walkthrough)
Followbright
 
PDF
Scheduling in Android
Opersys inc.
 
PDF
Android Things Internals
Opersys inc.
 
PDF
Die Android Plattform
Moritz Haarmann
 
Facebook Scaling Overview
Moritz Haarmann
 
Use open source and rapid prototyping to put magic in magical products in IoT
Moe Tanabian
 
Marketing and Technology Go Hand-in Hand, But Where are They Going?
Mogul Marketing
 
Memory Management in Android
Opersys inc.
 
Simple Web Design Case Study (Website Design Process Walkthrough)
Followbright
 
Scheduling in Android
Opersys inc.
 
Android Things Internals
Opersys inc.
 
Die Android Plattform
Moritz Haarmann
 
Ad

Similar to Google Go Overview (20)

PDF
Inroduction to golang
Yoni Davidson
 
PDF
Introduction to Go programming language
Slawomir Dorzak
 
PPTX
Go. Why it goes
Sergey Pichkurov
 
KEY
Beauty and Power of Go
Frank Müller
 
ODP
Ready to go
Atin Mukherjee
 
PPTX
Should i Go there
Shimi Bandiel
 
PPTX
The GO Language : From Beginners to Gophers
I.I.S. G. Vallauri - Fossano
 
PPTX
Lightning talk: Go
Evolve
 
ODP
Introduction to Go for Java Developers
Laszlo Csontos
 
PDF
10 reasons to be excited about go
Dvir Volk
 
PDF
LCA2014 - Introduction to Go
dreamwidth
 
PDF
golang_refcard.pdf
Spam92
 
PPTX
Go fundamentals
Ron Barabash
 
PDF
Golang
Felipe Mamud
 
PDF
Go Lang Tutorial
Wei-Ning Huang
 
PPTX
Next Generation Language Go
Yoichiro Shimizu
 
PPTX
Introduction to go lang
Amal Mohan N
 
PDF
2011 july-nyc-gtug-go
ikailan
 
PPTX
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
PDF
Go. why it goes v2
Sergey Pichkurov
 
Inroduction to golang
Yoni Davidson
 
Introduction to Go programming language
Slawomir Dorzak
 
Go. Why it goes
Sergey Pichkurov
 
Beauty and Power of Go
Frank Müller
 
Ready to go
Atin Mukherjee
 
Should i Go there
Shimi Bandiel
 
The GO Language : From Beginners to Gophers
I.I.S. G. Vallauri - Fossano
 
Lightning talk: Go
Evolve
 
Introduction to Go for Java Developers
Laszlo Csontos
 
10 reasons to be excited about go
Dvir Volk
 
LCA2014 - Introduction to Go
dreamwidth
 
golang_refcard.pdf
Spam92
 
Go fundamentals
Ron Barabash
 
Golang
Felipe Mamud
 
Go Lang Tutorial
Wei-Ning Huang
 
Next Generation Language Go
Yoichiro Shimizu
 
Introduction to go lang
Amal Mohan N
 
2011 july-nyc-gtug-go
ikailan
 
Golang - Overview of Go (golang) Language
Aniruddha Chakrabarti
 
Go. why it goes v2
Sergey Pichkurov
 

Recently uploaded (20)

PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
Simple and concise overview about Quantum computing..pptx
mughal641
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Agile Chennai 18-19 July 2025 | Emerging patterns in Agentic AI by Bharani Su...
AgileNetwork
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
The Future of Artificial Intelligence (AI)
Mukul
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
Doc9.....................................
SofiaCollazos
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Simple and concise overview about Quantum computing..pptx
mughal641
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Software Development Methodologies in 2025
KodekX
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 

Google Go Overview