Introducing Go 1.6
Go 1.6
Go 1.6
Feb 2016
(couple days ago)
Introducing Go 1.6
Brad Fitzpatrick
@bradfitz
bradfitz@golang.org
Introducing Go 1.6:
asymptotically approaching boring
Brad Fitzpatrick
@bradfitz
bradfitz@golang.org
Introducing Go 1.6:
asymptotically approaching boring
Brad Fitzpatrick
@bradfitz
bradfitz@golang.org
History
And Go’s release cycle
Go 1.5
Aug 2015
Go 1.4
Dec 2014
Go 1.3
Jun 2014
Go 1.2
Dec 2013
Go 1.1
May 2013
Go 1
Mar 2012
Go 1.6
Feb 2016
Go 1.7
Aug 2016
Go 1.8
Feb 2017
Go 1.9
Aug 2017
Go 2.0 !!!
Feb 2018
Generics!
Sum Types!
List comprehensions!
Immutability!
Rationalizing
[]byte vs string
Rationalizing
new() vs make()
Rationalizing
:= vs var
VFS layer,
os.File becomes an interface
~memory
@ownership!
Data races statically impossible!
Years of mistakes revisited...
Tons of feature requests resolved...
YAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAYAY
Are you excited yet!?!?
Sorry.
I lied.
Go 1.9
Aug 2017
Go 1.10
Feb 2018
Go 1.11
Aug 2018
etc.
So… when is Go 2?
No plans.
Maybe never.
http://brenda1eye.blogspot.com/2009_05_01_archive.html
http://hawkeview.blogspot.in/2010/05/great-gopher-war.html
https://twitter.com/jrstahl/status/591656618275819520
Previous Language Additions
(was it ever not boring?)
Go 1
Mar 2012
Go 1
Go 1.1
May 2013
Go 1.1
type T struct { … once sync.Once … }
func (t *T) init() { … }
func (t *T) method() {
t.once.Do(t.init) // t.init of type func(); t curried
Go 1.2
Dec 2013
Go 1.2
slice := array[off:len:cap]
Go 1.3
Jun 2016
Go 1.3
Go 1.4
Dec 2014
Go 1.4
Go 1.5
Aug 2015
Go 1.5
m := map[Point]string{
{1, 2}: "Foo",
{3, 4}: "Bar",
}
Go 1.6
Feb 2016
Go 1.6
Thank you!
Questions?
[ Excitement, pre-Go1 ]
weekly.*, r56, r57, etc
[ Go 1.x era ]
https://twitter.com/jrstahl/status/591656618275819520
Boring?
If you’re a language nerd.
Boring is exciting!
If you like stability.
Stable foundation
→
build stuff on top
“Go”
Language
Standard Library
Runtime
Tools
Ecosystem
Language
Basically frozen.
golang.org/ref/spec
Standard Library
Increasingly frozen.
External packages preferred.
Runtime
Garbage Collector,
maps, channels,
goroutine scheduler
Active development.
Tools
cmd/compile, gccgo, godoc, go doc, go vet, gofmt,
goimports, guru, gorename, …
Active development.
Ecosystem
External packages, compilers, tools.
Exploding.
Excitement elsewhere
excitement higher in the stack,
and in non-language areas of the foundation
Excitement besides
the language...
Go 1
Mar 2012
golang.org/doc/go1compat
Go 1 compatibility promise
Go 1: the beginning of tooling
Go 1.1
May 2013
Go 1.1
Go 1.2
Dec 2013
Go 1.2
Go 1.3
Jun 2016
Go 1.3
Go 1.4
Dec 2014
Go 1.4
Go 1.5
Aug 2015
Go 1.5
Go 1.6
Feb 2016
Go 1.6
but….
Go 1.6: More Platforms
Current OS support:
Current and new architecture support:
Go 1.6: Garbage Collector
Refined.
Go 1.6: cgo memory sharing
Defined.
Go 1.6: automatic HTTP/2
client & server
image by @igrigorik
Demo: http2.golang.org/gophertiles (video)
http.Get, Client.Post, Do, etc.
no changes
http.ListenAndServeTLS
no changes
Use TLS!
LetsEncrypt, ACME, Caddy = Free!
Go 1.6: template package
now
with
less auto-generated
whitespace
Go 1.6: template package
{{now -}}
{{with -}}
{{- less}} {{- auto-generated -}}
{{- whitespace}}
Go 1.6: template package
now with less auto-generated whitespace
Go 1.6: template package
and {{block}}
Go 1.6: faster
crypto, compression, sorting, etc.
more escape analysis
Go 1.6: map misuse detection
best-effort, always-on check of concurrent R+W, W+W
Go 1.6: Windows timer resolution
better battery life on Windows
Go 1.6: stdlib changes
~50 things mentioned in release notes
So now what?
Go 1.6.1
the “whoops!” release
Go 1.7
Hacking time! Started this morning!
Due Aug 2016
Go 1.7: SSA
faster, smaller generated code
$ find . -name '*.rules'
./src/cmd/compile/internal/ssa/gen/AMD64.rules
./src/cmd/compile/internal/ssa/gen/generic.rules
// constant folding
(Neg8 (Const8 [c])) -> (Const8 [-c])
(Neg16 (Const16 [c])) -> (Const16 [-c])
(Neg32 (Const32 [c])) -> (Const32 [-c])
(Neg64 (Const64 [c])) -> (Const64 [-c])
// canonicalize: swap arguments for commutative operations when one argument is a constant.
(Eq64 x (Const64 <t> [c])) && x.Op != OpConst64 -> (Eq64 (Const64 <t> [c]) x)
(Eq32 x (Const32 <t> [c])) && x.Op != OpConst32 -> (Eq32 (Const32 <t> [c]) x)
(Eq16 x (Const16 <t> [c])) && x.Op != OpConst16 -> (Eq16 (Const16 <t> [c]) x)
(Eq8 x (Const8 <t> [c])) && x.Op != OpConst8 -> (Eq8 (Const8 <t> [c]) x)
// simplifications
(Or64 x x) -> x
(Or64 (Const64 [0]) x) -> x
(Or8 (Const8 [0]) x) -> x
(Or64 (Const64 [-1]) _) -> (Const64 [-1])
(Or8 (Const8 [-1]) _) -> (Const8 [-1])
(And64 x x) -> x
(And64 (Const64 [-1]) x) -> x
(And64 (Const64 [0]) _) -> (Const64 [0])
(Xor64 x x) -> (Const64 [0])
// Lowering arithmetic
(Add64 x y) -> (ADDQ x y)
(AddPtr x y) -> (ADDQ x y)
(Add32 x y) -> (ADDL x y)
(Add16 x y) -> (ADDW x y)
(Add8 x y) -> (ADDB x y)
(Add64F x y) -> (ADDSD x y)
…
(Lsh8x64 <t> x y) -> (ANDB (SHLB <t> x y) (SBBLcarrymask <t> (CMPQconst y [8])))
(Lsh8x32 <t> x y) -> (ANDB (SHLB <t> x y) (SBBLcarrymask <t> (CMPLconst y [8])))
(Lsh8x16 <t> x y) -> (ANDB (SHLB <t> x y) (SBBLcarrymask <t> (CMPWconst y [8])))
(Lsh8x8 <t> x y) -> (ANDB (SHLB <t> x y) (SBBLcarrymask <t> (CMPBconst y [8])))
…
// fold LEAQs together
(LEAQ [off1] {sym1} (LEAQ [off2] {sym2} x)) && canMergeSym(sym1, sym2) ->
(LEAQ [addOff(off1,off2)] {mergeSym(sym1,sym2)} x)
// LEAQ into LEAQ1
(LEAQ1 [off1] {sym1} (LEAQ [off2] {sym2} x) y) && canMergeSym(sym1, sym2) && x.Op != OpSB ->
(LEAQ1 [addOff(off1,off2)] {mergeSym(sym1,sym2)} x y)
(LEAQ1 [off1] {sym1} x (LEAQ [off2] {sym2} y)) && canMergeSym(sym1, sym2) && y.Op != OpSB ->
(LEAQ1 [addOff(off1,off2)] {mergeSym(sym1,sym2)} x y)
Rules easy to add…
… sent this morning
Go 1.7: vendor always on
no more GO15VENDOREXPERIMENT
Go 1.7: new *.a files
smaller, faster
Go 1.7: zip-based *.a files
4x smaller $GOPATH/pkg/*
Go 1.7: binary export data
Go 1.7: compression optimizations
faster zip/flate
Go 1.7: smaller binaries
already in progress
… sent this morning
Go 1.7: faster builds?
Go 1.5 was unfortunate
Go 1.6’s lack of fix was a little embarrassing
Go 1.7: new GC tuning, experiments
goroutine-local young gen, maybe?
Go 1.7: http2 PUSH_PROMISE?
and performance optimizations
(profile + tune frame/TLS record sizes)
Go 1.7: IDNA?
http.Get(“https://ಹಲೋ.in”)
net.Dial(“tcp”, “ಹಲೋ.in:443”)
Go 1.7: more architectures
add SPARC64, S390[x]
optimize PPC64 & ARM64 & MIPS64
maybe add RISC-V?
Go 1.7: little stdlib things
many open Go1.7 feature requests
Go 1.7: SSA
did I mention SSA?
Go 1.8
Feb 2017
Go 1.8: ???
More compiler polish (more SSA),
Better GC
etc.
Go 1.9: ???
you get the picture
Go 1.10: ???
you get the picture
Go 1.x
Solid foundation to build upon
Excitement can be found upstairs
Thank you!
Questions?