Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: ee1ed6637a
Fetching contributors…

Cannot retrieve contributors at this time

file 187 lines (103 sloc) 2.821 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187
Go is Awesome
(and you should be using it)

Caleb Spare
Ooyala
caleb@ooyala.com



* This talk will not teach you Go

But I hope you're interested to learn more afterwards.

This talk will include:

- A brief intro to the language and tools
- Code
- Demos
- Gophers




* Overview

* A brief history

- Developed at Google starting in 2007.
- Open-sourced in 2009.
- Original creators: Robert Griesemer, Rob Pike, and Ken Thompson.
- Go now has many contributors both inside and outside of Google.
- March 2012: Go 1 released.

.image images/gopherbw_small.png




* The language

- Statically typed, with type inference
- Generates fast native code
- Compiles _really_ quickly
- Simple and fun
- Has pointers (but none of the dangerous stuff)
- Concurrent
- Garbage-collected

.image images/run.png



* Go is opinionated

- Public/private is determined by initial upper-case letters
- Error handling
- No classes/inheritence
- Aggressive focus on language simplicity and orthogonality of features
- Built to help software engineers, not advance PL research




.image images/talks.png



* Go on everything

Go has a spec, and two separate compilers that implement it.

gc:

- The original Go compiler
- So fast
- (x86, x64, ARM) × (Linux, OS X, Windows, FreeBSD, OpenBSD, NetBSD, Plan 9)

gccgo:

- A GCC frontend for Go
- Included in GCC 4.7.1 (released in June)
- Sometimes generates more optimized code
- Supports additional architectures (PPC, MIPS, SPARC, ...) and OSes (Solaris, IRIX, ...)



* Dat tooling

- go
- go get
- gofmt
- gofmt -r
- go test
- gofix
- go vet
- godoc
- gdb
- profiling

.image images/project.png



* Code Examples



* Our hello world is a server

.play hello_net.go



* Concurrency

.play concurrency.go /START OMIT/,/END OMIT/



* Demos


* Building go code

Build and run:

  go run mycode.go

Just build an executable:

  go build mycode.go

Oh, your server is a different platform?

  GOARCH=amd64 GOOS=linux go build


.image images/pkg.png


* Your deploy script

  #!/bin/bash

  scp myserver root@prod-server1.us-east-1.ooyala.com:/opt/awesome_server/

.image images/help.png


* Go in the industry

- Google (golang.org, youtube, dl.google.com, ...)
- Canonical
- Heroku
- SoundCloud
- Stathat
- Bitly
- Nokia
- BBC Worldwide
- ...

.image images/ref.png



* ...Ooyala?

- Docs: yard-doc.ooyala.com
- hastur-go
- go-ooyala-headers
- Go is already in production! (almost)

.image images/frontpage.png



* Get started!

.link http://tour.golang.org/ Go Tour
.link http://golang.org/doc/effective_go.html Effective Go
.link https://gobyexample.com/ Go by Example
.link http://golang.org/doc/codewalk/ Code Walks
.link http://golang.org/pkg/ Stdlib docs
.link http://go.pkgdoc.org GoPkgDoc
.link http://play.golang.org/ Go Playground

.image images/appenginegopher_small.jpg
Something went wrong with that request. Please try again.