
The State of Go – Where we are in May 2017 - astdb
https://talks.golang.org/2017/state-of-go-may.slide#1
======
nickcw
> vendor directories are ignored by the go tool #19090:

Hooray!

No more Makefile spaghetti like this (well a bit less anyway!)

    
    
        GO_FILES := $(shell go list ./... | grep -v /vendor/ )
        go test $(GO_FILES)
        go tool vet . 2>&1 | grep -E -v vendor/ ; test $$? -eq 1
        errcheck $(GO_FILES)
        find . -name \*.go | grep -v /vendor/ | xargs goimports -d | grep . ; test $$? -eq 1
        go list ./... | grep -v /vendor/ | xargs -i golint {} | grep . ; test $$? -eq 1
    

should become

    
    
        go test ./...
        go tool vet ./...
        errcheck ./...
        goimports -d .
        golint ./...
    

I assume the `./...` changes will just work in `errcheck` and `golint` but I
suspect `goimports` might need a bit of work.

~~~
Kubuxu
Only if `go test -cover ./...` would work. Currently in needs a lot of magic
[1] (ignore sharness test coverage magic, it uses even more magic [2]).

[1]: [https://github.com/ipfs/go-
ipfs/blob/master/coverage/Rules.m...](https://github.com/ipfs/go-
ipfs/blob/master/coverage/Rules.mk#L12-L27)

[2]: same file as [1], we compile unit test using `go test -c -cover` that
runs our main function and saves the return value to file ([3] and [4]), but
it works. If someone considers doing that, run everything in ramfs (tmpfs).

[3]: [https://github.com/ipfs/go-
ipfs/blob/master/coverage/main/ma...](https://github.com/ipfs/go-
ipfs/blob/master/coverage/main/main.go) [4]: [https://github.com/ipfs/go-
ipfs/blob/master/cmd/ipfs/runmain...](https://github.com/ipfs/go-
ipfs/blob/master/cmd/ipfs/runmain_test.go)

------
heyts
Video of the presentation on youtube
[https://www.youtube.com/watch?v=giUatBmmb_Y](https://www.youtube.com/watch?v=giUatBmmb_Y)

------
jayflux
The slides don't work very well on an iPad mini :( Going to the next slide
skips 2 at a time

~~~
Someone
For me, on an iPad, dragging moves 1.5 slide, but clicking at the left or
right edges moves one slide (correction: that's a bit state-dependent. I _can_
make it reliably work that way, but it may require some 'random' zooming to
get there)

------
jayd16
Strange that Go and Dart are completely missing from I/O this year.

~~~
geodel
No. At Least Go is not there on Google I/O for last few years. To me it is
encouraging that Go has its own conference Gophercon and not riding on Google
I/O.

I believe Go at Google does not have same relationship as Java at Oracle or
Swift at Apple.

~~~
akerro
>I believe Go at Google does not have same relationship as Java at Oracle or
Swift at Apple.

Could you tell me more about it, please?

~~~
coldtea
> _Could you tell me more about it, please?_

Google never cared for Go.

It wasn't created as a strategic project or investment. It's a language
created by a small team on Google doing their thing.

It does keep paying them to work on Go though (and probably devoted some more
people to it), so there's that, but Google neither hired them specifically for
Go, nor requested that they work on such a project from the onset.

It was also never made THE official language for Google development by some
decree, nor was getting it to Android any priority (they favored Kotlin for
that in the end). Neither was it ever strongly marketed by Google to outside
developers.

Dart/Angular got more of an official "sponsoring" from Google (including
devoting a top notch compiler guy like Lars Bak to work for the former) than
Golang. From what I've heard, it has seen adoption inside Google, but nothing
game changing.

~~~
skybrian
There's no single official language at Google; it's a multi-language place.
Google's build system (bazel) is multi-language. Internally, Go is as official
as it gets.

While Java is most common, there's no single language for Android, either. C++
was always used for games, Kotlin is now officially supported, and Dart is in
alpha via Flutter: [https://flutter.io/](https://flutter.io/)

(Not to mention all the different languages supported on Cloud.)

Anything you say about "Google" caring for a language is probably true of some
teams and not true of others.

~~~
coldtea
> _There 's no single official language at Google; it's a multi-language
> place. Google's build system (bazel) is multi-language. Internally, Go is as
> official as it gets._

Not a Googler (or even close), so can't verify, but from what I've heard it's
like this:

Google backend is C++, Java and Python. To this, they also allow Go now (and
for some years).

But Go was never meant as a "create us an new official Google language to rule
them all" directive, or even "create a language that solves Google scale
programming issues". (I mean, the Go team had the latter issues in mind --
but, Google itself didn't, and didn't ask for such thing officially (in the
way they officially jumpstarted projects like V8, or Dart, or GWT etc). The Go
team created Google on their own, not as some official "new Google language"
decree from above).

> _While Java is most common, there 's no single language for Android, either.
> C++ was always used for games, Kotlin is now officially supported, and Dart
> is in alpha via Flutter: [https://flutter.io/*](https://flutter.io/*)

Well, it might sound like there are 3 languages now (and 4 soonish), but
officially apps were meant to be coded in Java/Davlik, and high perf games in
C++ for almost a decade. So, as far as Android official languages go, it has
been Java all the way for app development for ages...

------
winteriscoming
A bit OT - does anyone know what tool was used to create those slides? They
look very light and clean and something I might experiment with for technical
presentations.

~~~
fgrimes
[https://godoc.org/golang.org/x/tools/present](https://godoc.org/golang.org/x/tools/present)

[http://halyph.com/blog/2015/05/18/golang-presentation-
tool.h...](http://halyph.com/blog/2015/05/18/golang-presentation-tool.html)

------
kureikain
I use Go and love it. That's the only thing in my app achive sub ms latency.

That is being sad, Go is still not as mature as other language such as Ruby,
Java, Python,...etc in term of eco system around web application.

Take database for example. Any web app needs to interact with MySQL, MongoDB
etc. But the performance of those drivers are somehow lack behind when I
compare them with other driver. MongoDB/MySQL drivers are both seems come from
individual works of excellent/talented developer than official support from
those database.

Go shines in system/devops stuff though.

~~~
zacmps
That surprises me, go does use prepared statements by default. Could that be
it?

------
tptacek
sync.Map is kind of a big deal.

~~~
saintfiends
Also a shining example of their poor type system.

~~~
exacube
how so? how would a type system have helped here

~~~
tptacek
Since everything in sync.Map appears to be laundered through interface{}, you
lose compile-time type safety where you use it.

~~~
fmstephe
Another concern (big or little depending on your circumstances) many common
things stored in maps, strings, primitives, incur an allocation on conversion
to interface{}.

Coupled with a fairly inefficient GC it means I would need to think twice
before using this.

~~~
gtirloni
What's inefficient about Go's GC ?

~~~
fmstephe
I think pcwalton expressed it clearly here

[https://news.ycombinator.com/item?id=14380575](https://news.ycombinator.com/item?id=14380575)

~~~
gtirloni
Thanks. I also found this other discussion useful:
[https://news.ycombinator.com/item?id=12042302](https://news.ycombinator.com/item?id=12042302)

------
dejawu
The bit about better "errors" for Allman style braces really drives home to me
just how proudly opinionated Go is. "We know about this other indent style and
acknowledge it, but it's WRONG."

I really gave Go a good shot, built a project of decent size with it and used
it as my go-to first choice for a few others, but every time these little
nitpicks come back and make it feel like Go is smacking my hands away from the
keyboard. "Bad programmer! You didn't do it the way I wanted you to!"

I would love to use a hypothetical "Go++" that's built from the same roots of
Go but forgoes its opinionated nature, even if it's at the cost of messier
code. Someone somewhere has to be working on that... maybe I should give it a
try.

~~~
dilap
man for me that's such an advantage of Go. i dont think brace style & other
style quirks matter that much, but having them be _consistent_ really helps a
lot. so just pick one style and be done with it.

also, having all code use the same style means you can safely search for
semantics just using a syntactic pattern.

~~~
__david__
I think consistency is very overrated by the go community. I read and work on
a lot of C code, and styles vary considerably. It's just not hard to read code
in different styles. And my main problem is not that `go fmt` enforces a
specific style, but that it enforces a specific style that actively harms
readability. Defaults are good as long as they are sane, but `go fmt` made
some really stupid decisions.

~~~
baby
Go read OpenSSL's code before they decided to have a consistent style[^1] and
come back here

[^1]:
[https://github.com/openssl/openssl/blob/7a71af86ce75751f3cb2...](https://github.com/openssl/openssl/blob/7a71af86ce75751f3cb2e9e9e3f2e0715b39b101/ssl/ssl_rsa.c)

~~~
__david__
The style in that file seems completely self consistent. I don't know what
your point is.

~~~
baby
Browse different files in the repository at that time, not just one file.
Different files will have different styles, and awful ones at that.

------
spyspy
> http.DoGetPleaseAndThanks

I genuinely can't tell if they're joking or not.

~~~
shurcooL
I think it's just an example of a different name to explain a feature. Not
something anyone would actually implement.

------
LanceH
quaternions?! This is exactly something I need but never would have expected
in the base language.

~~~
pjmlp
Usually with languages that are feature rich they can be plain library types.

With Go, they will keep adding special case after special case.

~~~
masklinn
> Usually with languages that are feature rich they can be plain library
> types.

Eh, in most languages you'd still need language support if you want quaternion
literals.

~~~
int_19h
Literals are usually not a big issue. You don't get that much in going from "1
+ 2i" to "complex(1, 2)" or something like that. It's value type semantics,
operator overloading, and implicit conversions that are usually challenging.

Go doesn't have _any_ form of customized operator overloading. If something
needs to look like a number, it has to be in the base language. Stuff that
isn't, is second-class even if it's in the standard library.

Ironically, this is the case for big integer / floating-point numbers - you
have to write things like x.Add(y, z):
[https://golang.org/pkg/math/big/](https://golang.org/pkg/math/big/)

------
alanbernstein
Why can't these talks have scroll bars, or some other indicator of where you
are in the document?

~~~
pekim
I agree, I want to know how far through I am, and how much further I have to
go. I would be happy with a simple 'n of m' or 'n/m' indication.

------
galfarragem
According Stackoverflow Typescript is winning:

[https://insights.stackoverflow.com/trends?tags=go%2Ctypescri...](https://insights.stackoverflow.com/trends?tags=go%2Ctypescript%2Cscala%2Ckotlin%2Cdart)

~~~
appleflaxen
wow! that graph is not what I would have expected (not sure what I would have
expected, but... typescript and scala are dwarfing other languages... wow)

But it's dwarfed by c, c++, and javascript. Graph when you add a bunch of
other languages:

[https://insights.stackoverflow.com/trends?tags=go%2Ctypescri...](https://insights.stackoverflow.com/trends?tags=go%2Ctypescript%2Cscala%2Ckotlin%2Cdart%2Cclojure%2Celixir%2Clisp%2Chaskell%2Crust%2Cc%2Cc%2B%2B%2Cjavascript)

~~~
galfarragem
IMO the most interesting from all these popularity trends is the rise of
Python:

[https://insights.stackoverflow.com/trends?tags=python%2Cjava...](https://insights.stackoverflow.com/trends?tags=python%2Cjavascript)

------
appleflaxen
the very first slides talk about the deprecation and removal of old APIs. if
there are any HN readers who influence go, consider Rich Hickey's argument [1]
regarding deprecation and code removal.

Bottom line: he proposes that one should never take away a function/API
(particularly when you are a library or programming language).

[https://www.youtube.com/watch?v=oyLBGkS5ICk](https://www.youtube.com/watch?v=oyLBGkS5ICk)

edit: superficial word choice

------
perseusprime11
Kotlin is becoming more and more popular. Are we better off learning Kotlin
instead of Go?

~~~
msluyter
Like someone mentioned, it's hard to answer this in the general case. Factors
to consider would be: a) are you dependent on the JVM and Java ecosystem? b)
Are you already familiar/comfortable with Java/Scala? "Yes" answers to both of
these might lean you towards Kotlin.

c) is speed essential? d) are you doing systems programming as opposed to CRUD
webapps?[1] These might lead you to Go.

[1] I know you can do the latter in Go, but it's unclear that it's as
easy/productive as in other langs currently (nor have I directly compared,
say, Revel to other frameworks, so someone else is probably better qualified
to answer this question.)

~~~
candiodari
If you want speed, use golang ?

Java (and kotlin) are faster than Go in almost all cases (except for startup
time) (and even there difference is shrinking, plus you get a lot back for
that startup time). C, if you must, is faster still, and C++ can be faster as
well.

As a quick (and inaccurate) rule, any program that runs longer than 10-20
seconds will be faster in Java than in Go.

~~~
vbezhenar
What about memory? I wouldn't run any kind of production Java web server with
256M RAM server. I've had impression that Golang is much less memory-
dependant.

~~~
sebcat
Not sure about the most recent versions, but Go can run on MIPS platforms with
32MB RAM.

------
t3h2mas
But where does one find the slides though?

------
ruleabidinguser
quaternions? seems a little silly

~~~
JW_00000
It was an April Fools' joke.

------
kmicklas
Q: Where is Go in May 2017?

A: 1970

------
deepsun
Hmm, still no generics...

