
Four years of Go - enneff
http://blog.golang.org/4years
======
kevrone
We are writing/rewriting a lot of services at Timehop in Go. It's not _quite_
as productive as programming in ruby, but it's surprisingly close (For simple
services, anyhow) and its multiplexing characteristics seem pretty slick when
you're used to using delayed_jobs in ruby.

However, if you do a lot of collection processing, you start to really itch
for something like generics (Which can lead down some pretty interesting
rabbit holes: [http://blog.burntsushi.net/type-parametric-functions-
golang](http://blog.burntsushi.net/type-parametric-functions-golang)). I think
this is a pretty big feature to be missing, actually. I hope it comes soon in
future updates. It's pretty frustrating to have to reimplement data structures
that can accomodate custom structs.

But overall, it's very impressive, and a step in the right direction. I think
we're approaching a golden age of programming languages, where syntax,
expressiveness, and performance are all given equal seats at the table.

------
donutdan4114
I am only a beginner in Go, but what I have done so far, I have loved. It's a
great alternative to your typical scripting languages like PHP, Perl, Python,
Ruby, Node, etc, etc, etc... And simpler and funner to use than C/C++ IMO.

I really hope it keeps gaining momentum.

~~~
dmak
Could you go into detail on your experiences for Go compared to JS or Ruby?

~~~
miloshadzic
I know Ruby and some Go and never really understood why people compare them so
much. Very different languages.

~~~
jacques_chester
On HN there's a lot of people who went from writing Ruby to writing Go. If all
you have are a hammer and a screwdriver, everything looks like a blog post
comparing the two tools you've tried.

------
chetanahuja
Looks like Go is succeeding more in the space where scripting languages like
Python and Ruby are dominant and less in it's original intended space (systems
programming). Rob Pike has written about it too. I wonder if they see this as
an opportunity missed or unexpected boon.

~~~
enneff
We definitely made a mistake at launch using the term "systems programming",
because people automatically think of operating systems. What we meant were
the kind of systems we build at google. Some of the examples in the blog post
are "systems programming" in the same sense.

So we are pleased to see Go being used for the job it was designed for, but we
are also happy to see that Go has a broader appeal.

~~~
laureny
> So we are pleased to see Go being used for the job it was designed for,

This sounds a bit like revisionism. Rob Pike made it clear that the initial
motivation for Go was the slowness of the C++ compilation.

Go was clearly initially targeted at replacing C++ and it's not being
successful in that area at all.

Personally, I think it will grab a decent amount of Ruby and Python
programmers but it won't go much further than that.

~~~
axaxs
I see that as an obvious mistake. C++ is so different than C, and I imagine
most C purists despite it. Go created a smarter C, and presented it as the
solution. The problem though is that C++ people likely aren't C purists to
begin with, or that C purists are too into C. Compounded by those who only
drop to C when needed, you begin to see why it failed initially in this
segment. I do think it will continue to gain adoption, but linux is such a
firm C membership club that it will either be painfully slow, or else require
Go to play nicer with C.

~~~
pcwalton
> C++ is so different than C, and I imagine most C purists despite it. Go
> created a smarter C, and presented it as the solution.

I think it has nothing to do with the difference between C and C++ and
everything to do with the reasons why people use C and C++: extreme
performance, zero-cost abstractions, and integration with native libraries.

~~~
axaxs
I think you are right, and I tried to convey that in my last two sentences but
in retrospect worded it poorly. I guess what I was trying to say there is that
people who "drop to C"(or for that matter, start in C) for performance reasons
or compatibility reasons aren't going to consider a slower and less integrated
language. This is probably most people, I'm not sure many people write
everything in C regardless of task anymore(such as say, webapps).

I still think the initial part stands. C and C++ are not visually or mentally
similar languages. Go is very similar to C in logic, so I'm not sure why it
was expected that C++ people would flock to it(unless of course they weren't
happy with C++, which brings us back to the first condition in that they were
probably only using it for performance).

------
craigyk
I want to like Go. There's definitely some parts that are great, but for a
relatively new language there were missed opportunities to adopt awesome
features in other PLs. There are also some internal inconsistencies that I
find grating. These inconsistencies are particularly irksome given how
opinionated Go is (and how much I agree with most of those opinions).

~~~
craigyk
I went and looked up some of my notes back when I was trying out Go. I hope to
learn from others wether these are real issues or simply my misunderstandings.

1\. So we don't get generics, but the language built-ins seem to get to be
type-parameterized (channels, slices, maps). Unfortunately the syntax for
doing so for each of these is inconsistent (probably as a result of being
special-cased rather than dog-fooded using language-level generics): []float,
map[float]float, chan float.

2\. Built-in types seem to receive other special treatments as well, which
includes special initialization keywords (make vs. new) and built-in functions
(len, cap, etc.) but I don't see why this needed to be the case, even for
performance reasons. There's no reason why the these built-in types couldn't
_pretend_ to implement built-in interfaces to make more transparent with user-
types while having the compiler optimize them with special-case functions for
efficiency.

3\. Unused variables are a hard error which is a completely understandable
stance. Unfortunately, I think people may use workarounds to get around this.
Also, I can't believe unused variables are a hard error, but uninitialized
variables are not! Instead we are supposed to trust that everything is OK
since they get initialized to some kind of "zero" value that isn't even under
the developer's control.

4\. Other small quibbles: I think pattern matching on function arguments could
have been implemented as sugar that uses interfaces and method calls under the
covers. Also named return values are ugly, and the function declaration syntax
could have been made more concise.

------
knodi
I been using Go for a year now. Its hard to explain but for the most part I
enjoy coding with Go. I could say i find it fun/enjoyable but that doesn't
seem to convey the right feeling.

~~~
stock_toaster
When using Go, I sometimes get the same feeling I get when using a well made
drill, saw, or other physical tool. I would qualify it as "satisfying" \-- the
way it feels and how well it accomplishes the task it is designed for.

Like many well designed and well engineered things, I think familiarity and
time cause that satisfying feeling to blend into the background and become the
norm. You only realize the difference again when you have cause to use some
other tool laying around (I just need to pound this nail I will just grab this
random hammer laying here) and it "feels" different -- the weight is wrong or
the grip is weird.

I by no means claim Go is perfect, but it seems to a great match for the kinds
of things I tend to work on, and it "fits in my hand" rather well these days.

------
ARolek
I spend about 30% of my time system side in Go, and the rest in Node.js. I'm
working to migrate almost all of my time to Go. The language is fun to work in
and, personally, the overall experience is much improved over Node.js. It's
exciting to see the momentum behind the language and the great people who are
attracted to it.

~~~
Kiro
Are Node.js and Go used in separate systems or do they have their own special
places?

~~~
voidlogic
At a startup I worked for we used node.js prototype/sometimes v1.0 and Go for
everything after. We shifted to writing everything in Go as we reach a point
were we were more efficient from an effort standpoint in Go.

------
misnome
> "The state of the Go ecosystem after only four years is astounding. Compare
> Go in 2013 to Python in 1995 or Java in 1999. Or C++ in 1987!"

Wow! The state of C++ searches on google were 0 in 1987, as were searches for
"Apples" and "Oranges" so go must be doing incredibly well to have infinity
times the results!

~~~
enneff
Keith wasn't referring to the Google Trends chart. It is an unrelated quote
about the state of the various languages' ecosystems 4 years after their
release dates.

~~~
dbaupp
None of the languages being compared against were released in the ubiquitous-
internet age with things like Github and widespread blogging to drive interest
and adoption.

~~~
coldtea
> _None of the languages being compared against were released in the
> ubiquitous-internet age with things like Github and widespread blogging to
> drive interest and adoption._

Which doesn't seem to matter anyway. There are tons of languages released
every year that fare even worse than languages released in 1980, despite
having "ubiquitous-internet, Github and widespread blogging" at their
disposal.

~~~
dbaupp
How many are backed by one of the largest companies on the internet?

~~~
overcyn
What is your point here? This is a blog post celebrating the 4th anniversary
of a programming language. Shame on them for being proud of what they created
because other languages had a harder time?

------
sergiotapia
I'm betting on Go at the moment, using it to build some little libraries and
writing some dummy apps to test the waters.

Hopefully in 4 years when Golang developers are in demand, I have 4 years of
experience under my belt. :)

~~~
sitkack
Programming is now multi-language and multi-paradigm. It matters more what you
can do and not what you can do it in. Being able to compose libraries and
systems from parts is way more important than knowing a specific language.

~~~
genwin
I'm thinking Go has got to eventually eclipse Python in popularity, since the
former can do the same work using a fraction of the servers, for about the
same coding difficulty.

~~~
deckiedan
One place Go won't be replacing python (or perl) is in the "smarter shell-
scripts that don't suck" space. Being able to write a 10 line script, dump it
on the server and point cron at it, and then open it in situ to see what it's
doing is invaluable. Also, when things get a bit edgy, to copy the file, edit
2 lines, and run it to fix something that the original didn't cover...

It may be better than Python for some kinds of large applications programming,
I don't know. But since a lot of apps do need the simple scripts and the
application logic, it's kind of nice to have them all in the same language -
which is one place where javascript may take over more, I suppose, if ever
they can convince OS designers to build node.js tools into the default
installs...

~~~
asdasf
I find good old /bin/sh is better than perl or python for the use case you are
talking about. Perl rose out of the huge gulf between shell and C. The
distance from shell to go is much smaller.

~~~
deckiedan
I have a bunch of scripts which are written in standard shell, and for simple
stuff, it's fine. But as soon as it starts doing file name manipulation, or
working with collections of files (say finding the age of the most recently
changed file in a directory, and checking how long ago that was and changing
color-extended attributes of the enclosing directory so projects untouched in
over a month turn grey...), and you have people on the network who name files
by copying and pasting from word documents (I didn't even know you _could_ put
a newline in a filename!), I've found python to be much more reliable and easy
to write correctly.

~~~
asdasf
What you described is exactly what I mean by simple stuff where shell is
ideal. People generally find perl or python easier for those tasks because
they took the time to learn perl or python, but didn't take the time to learn
sh.

------
martinvol
There is a fallacy in this quote: "The state of the Go ecosystem after only
four years is astounding. Compare Go in 2013 to Python in 1995 or Java in
1999. Or C++ in 1987!" This comparison is more than unfair, in the 90's only a
few people had an internet connection. Or Do you want to create Open Source
projects by mail? Git or Subversion didn't even exist back then. Now imagine
in 1987...

~~~
laureny
> The state of the Go ecosystem after only four years is astounding. Compare
> Go in 2013 to Python in 1995 or Java in 1999. Or C++ in 1987!" This
> comparison is more than unfair,

It's more than unfair since they don't show any numbers. At all. Not for Go,
not for Java, not for anything.

The graph is cute but it's not even a number of installations, projects on
githubs or lines of source code: it's Google searches. Searches measure
nothing more than buzz. I bet Google Wave showed similar curves facing up for
months.

If the Go team had hard and impressive numbers, I bet they would show them.
The fact that they don't makes me think that Go is not seeing a lot of
traction, besides a few Python and Ruby programmers.

------
socksy
So I've given Go a try with a couple of projects, and I like it so far.
However, I really don't like its "warnings are errors" feature — in particular
in respect to unused imports. If I comment out a line that uses an import,
then it no longer compiles until I go to the top of the file and comment it
out.

Has anyone come up with a good solution to this? Preferably using Vim tooling.

~~~
dchest
Yep. In vim (make sure to have plugins that come with go in misc/vim/
directory installed):

    
    
       :Drop fmt
    

to remove package "fmt" from imports, and

    
    
       :Import fmt
    

to put it back.

------
dhaivatpandya
I'm currently working on a Go project that is meant to sit above the Hadoop
FS. Go has been absolutely brilliant to work with. Some of the design
decisions make very little sense at first (e.g. no fields in interfaces, no
real inheritance, etc.) but as I've used the language more and more, the
reasoning behind them becomes clear.

------
alok-g
Those experienced in Go, do you miss generics?

~~~
yuushi
I think interface{} is a horrible, horrible hack. For me, the answer is an
emphatic yes.

~~~
alok-g
Could you please explain more? :-)

~~~
yuushi
Sure. Think of void * in C. interface{} in Go isn't really that different,
there's just a bit more language support for testing if it satisfies a
specific type or not. Add in type assertions, and it's basically as though you
had a dynamic_cast in C++ that worked from void * to an interface type.

To me, it just seems ugly. I like a type system where I know what a type is at
each point, and there isn't some ugly "catch all" type that you can use when
you run out of other options, which effectively just throws away all type
information (and this is what interface{} does, as everything implements it).

------
codeka
When I look at the Google Trends for "golang", China is the top region by a
huge margin (the next highest region after China is Sweden at 30) [
[http://i.imgur.com/XHW40kp.png](http://i.imgur.com/XHW40kp.png) ].

And the rise of interest in "golang" in general seems to correspond to the
massive spike in China [
[http://i.imgur.com/Y3oO2jf.png](http://i.imgur.com/Y3oO2jf.png) ].

I'm not really sure what that means...

~~~
columbo
Could just be false signals for people googling "Go" the game and not the
language. Golang is the first search on a generic search for "Go"
([https://www.google.com.hk/webhp?hl=zh-
CN&sa=N&tab=lw#hl=zh-C...](https://www.google.com.hk/webhp?hl=zh-
CN&sa=N&tab=lw#hl=zh-CN&q=go&safe=strict)).

~~~
prewett
People in China that are searching for the game would probably be searching
for "weiqi" or "围棋". "Go" comes from the Japanese word for the game, "igo".

Also, in my experience, very few (mainland) Chinese play weiqi. Everyone plays
Chinese chess, but very few play Go. So people searching for "go" are quite
likely searching for the language. (Although I'd expect that the people who
know about the language know enough to search for "golang", so who knows)

------
motter
If you're in London, you might like to come to the Go user group which I run
with John Graham-Cumming:

[http://www.meetup.com/Go-London-User-
Group/events/147685182/](http://www.meetup.com/Go-London-User-
Group/events/147685182/)

Don't worry about the waitlist, people always drop out nearer the time.

------
AlexanderDhoore
I'll be at the Go room @ FOSDEM 2014! See you there.

------
islon
If hacker news is any indicator of success than go will become the most used
programming language soon.

Yeah I was been ironic but go is quite a nice language =)

------
pjmlp
> If you're in Europe in February 2014, come along to the Go Devroom at FOSDEM
> 2014.

Ok, so now I really have to attend next year's FOSDEM.

------
Grue3
Does it have exceptions yet?

~~~
masklinn
It's always had exception, despite what the community tries to make you
believe.

------
mynames
Does anyone knows why there is no support for Go in Android?

~~~
jff
Google's a big company with lots of fiefdoms, and Go is one of the smallest;
I'm not sure it even counts as a fiefdom. Android is heavily invested in
Java/C++ and those types don't like to admit that you can do anything
worthwhile in Go.

After compiling Android a few times, though, you'll appreciate what the Go
team was talking about when they said C++ compilation time was a driver for
them.

~~~
pjmlp
Well, support for Go on Android is already open for quite a while, so it seems
to be low priority

[https://code.google.com/p/android/issues/detail?id=39482](https://code.google.com/p/android/issues/detail?id=39482)

------
chris-at
Does a chart without a y-dimension say anything at all?

~~~
enneff
It's search volume. The values are 0 at the origin to 100 at the highest
point. But there are no units, I presume Google knows but doesn't give real
numbers.

------
trungonnews
How many more years until Go gets named parameters?

