the state of go - andrew gerrand
DESCRIPTION
http://www.hakkalabs.co/articles/state-goTRANSCRIPT
![Page 1: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/1.jpg)
The State of GoWhere we are in June 2014
Andrew Gerrand
![Page 2: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/2.jpg)
Yesterday
![Page 3: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/3.jpg)
Initial reception
Looking back on the first months.
![Page 4: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/4.jpg)
Complaints
The complaints started right away…
![Page 5: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/5.jpg)
Familiar complaints
![Page 6: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/6.jpg)
Familiar complaints
The first HN thread about Go was mostly an argument about braces and indentation.
![Page 7: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/7.jpg)
Historic moments
The first public language change (Dec 10, 2009):
![Page 8: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/8.jpg)
The gopher
![Page 9: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/9.jpg)
The gopher
![Page 10: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/10.jpg)
The gopher
![Page 11: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/11.jpg)
A keen observation
![Page 12: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/12.jpg)
Signs of hope
![Page 13: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/13.jpg)
Today
![Page 14: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/14.jpg)
Growth
![Page 15: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/15.jpg)
User groups
Today there are 48 active user groups in 15 countries across 5 continents.
![Page 16: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/16.jpg)
GopherCon
Community-driven. 3 days. 700 attendees. 24 talks. 1 panel. 4 hours of lightning talks!
![Page 17: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/17.jpg)
The gopher
![Page 18: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/18.jpg)
The gopher
![Page 19: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/19.jpg)
The gopher
![Page 20: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/20.jpg)
Go 1.3
Released last Wednesday, 18 June 2014.
Highlights:
Native Client support (amd64, 386)
DragonFly BSD, Plan 9, and Solaris support
Improved performance (GC, contiguous stacks, race detector, regexp)
Faster incremental builds (linker overhaul)
Precise GC of stacks
Static analysis in godoc
![Page 21: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/21.jpg)
Tomorrow
![Page 22: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/22.jpg)
Upcoming conferences
![Page 23: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/23.jpg)
Go 1.4
Due December 1st, 2014.
What might be in it? (Speculative list follows.)
![Page 24: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/24.jpg)
New language features
Nope.
![Page 25: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/25.jpg)
Canonical import paths
A means for a repository to specify its canonical import path.
Goal: stop people from checking out repos from the wrong path.
Applications:
Stable vanity import paths.
"camlistore.org" -> "camlistore.googlesource.com/camlistore"
Make GitHub's fork model less painful.
(Proposal forthcoming.)
![Page 26: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/26.jpg)
Internal packages
Current proposal:
"An import of a path containing the element “internal” is disallowed if the importingcode is outside the tree rooted at the parent of the “internal” directory."
Code in /a/b/c/internal/d/e/f can be imported only by code in the directorytree rooted at /a/b/c.
$GOROOT/src/pkg/internal/xxx can be imported only by other code in thestandard library ($GOROOT/src/).
And, later:
$GOPATH/src/mypkg/internal/foo can be imported only by code in$GOPATH/src/mypkg.
golang.org/s/go14internal (http://golang.org/s/go14internal)
![Page 27: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/27.jpg)
src/pkg → src
Move the standard library from $GOROOT/src/pkg to $GOROOT/src.
Basically makes $GOROOT work just like $GOPATH.
(Not a big deal for most, but a nice clean up for the core.)
golang.org/s/go14nopkg (http://golang.org/s/go14nopkg)
![Page 28: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/28.jpg)
File system access throttling
Throttling of access to the file system at the os package level.
Goal:
Launch a million goroutines that do file system stuff.
Don't launch a million operating system threads to block on the syscalls.
Make it work just as nicely as it does with the network.
(Proposal forthcoming.)
![Page 29: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/29.jpg)
"go generate"
A convenience for generating Go source code. Example uses:
yacc: generating .go files from yacc grammar (.y) files
protobufs: generating .pb.go files from protocol buffer definition (.proto) files
HTML: embedding .html files into Go source code
Other ideas abound…
Proposed mechanism:
Add generator directive in Go source files:
//go:generate yacc -o gopher.go gopher.y
Use the Go tool to execute the directives:
% go generate [packagepath]
(Proposal forthcoming.)
![Page 30: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/30.jpg)
More tool chain work
cmd/go support for gccgo
cmd/go support for embedded data files
Race detector improvements
The transition from C to Go continues:
Linker rewritten in Go (cmd/link)
Assembler rewritten in Go (cmd/asm)
Possibly: cmd/gc translated to Go
![Page 31: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/31.jpg)
Better GC and malloc
The existing allocator is based on TCMalloc (designed for C/C++). It can be re-designed to better suit Go.
Lighter representation and colocation of GC metadata.
Various strategies for reducing GC pause time (concurrent sweep, etc).
Rough estimate: 10-20% overall speedup, 20-50% GC pause reduction, 5-10% RSSreduction.
Details:
golang.org/s/go14mallocgc (http://golang.org/s/go14mallocgc)
![Page 32: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/32.jpg)
Other runtime changes
Concurrency improvements:
Lock-free fast path for non-blocking receive from empty channel.
Rewrite select to hold only one channel lock at a time.
C to Go:
G-stack runtime converted to Go.
![Page 33: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/33.jpg)
Package changes
Easier structuring features in text/template
Bring reflect.Value back to 3 words
Fix embedded field visibility (reflect)
Safe version of encoding/gob
Unicode 7 support
![Page 34: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/34.jpg)
Ports
Native Client arm
PowerPC 64
ARM64
![Page 35: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/35.jpg)
Go support for Android
Go support for the NDK. (Like C/C++ today, but better!)
Goal: enough support for writing games.
Based on the work of Elias Naur and others in the community.
golang.org/s/go14android (http://golang.org/s/go14android)
![Page 37: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/37.jpg)
Questions?
![Page 38: The State of Go - Andrew Gerrand](https://reader033.vdocuments.mx/reader033/viewer/2022052618/554f4640b4c90572088b5691/html5/thumbnails/38.jpg)
Thank you
Andrew Gerrand