85 points · by fogus · 16y ago · 70 comments
It may not be as beautiful as CoffeeScript (which we also use), as rich as Python, as safe as Rust, as concurrent as Erlang, or even as hackable as Ruby, but it certainly offers an unparalleled set of features which is hard to find in just one language — decent standard library, decent syntax, decent performance, super easy concurrency, a helpful and reasonably sized developer community, a relative level of stability, automatic memory management with good enough control over memory use, usable interoperability with C, native client support and even a standard testing framework.
Thank you and happy birthday to all the fellow Go developers out here on HN.
As a question: do you see parts of your startup expanding past the area of Go? Would a mixture of other languages help?
But, having said all that, the biggest surprise has been how Go has become the dominant language within our code base. We initially started using Go to just handle the networking layer. But it soon became apparent that Go was perfectly viable as a general purpose language. And today the majority of our code is written in Go.
So, whilst we'll continue to leverage other languages for what they are good at, I can confidently say that Go will be at the heart of our technology stack for the forseeable future. And with the various "good enough" statements, I was trying to say that although Go is not the best language ever for specific features (e.g. syntax, standard library, etc.), it definitely offers the best all round set. And the situation only gets better every day. So I'll definitely say that Go is more than good enough.
I hope other language designers take note of Go and put more emphasis on simplicity in the future.
I would also be very interested to know which companies are using Go, and for what.
Google is hiring people to design languages and tools that know absolutely nothing about modern language design techniques, or what modern software engineering tools look like.
If you're paying any attention at all to Go, you're not learning anything. In fact, it's possible you're damaging your brain. It's projects like these that make Google look really bad and unattractive to programming language researchers, especially as compared to Adobe, IBM, Sun, and Microsoft.
From here: http://lambda-the-ultimate.org/node/3896
That's a joke right?
Moreover, I care not one whit that Google looks "really bad and unattractive to programming language researchers"; because I'm not one.
I don't think LtU approval is necessary to have done something good. We need more tools that help programmers solve problems of concurrency without losing their feet.
Tools that aren't entirely groundbreaking are very useful here, because you can take a guy who knows only c++ and have him write a bit of go. I can't as easily get him to use twisted or erlang or even node.js.
(I know, he would probably disagree with Pike, Thompson et al., too, but on different principles.)
It was successful in that I found it very easy to express what I wanted and make a concurrent app to do it. It didn't actually find a bug (I'm not entirely sure there was one, but the code that fell out of it is reusable for my next one).
When go first came out, I wrote a memcached server in it: http://dustin.github.com/2009/11/12/gomemcached.html -- the language was a little rougher when I started the project (defer didn't work properly until last march), but I still feel pretty good about it.
Well, that's it. If I can't have a brace-war tearing the dev group apart for months and kill productivity, I want nothing to do with that language. What's next, significant white space?
Erlang is based originally on Prolog, a logic programming language that was briefly hot in the 80's. Surely you've seen other languages based on Prolog, right? No? Why not? Because Prolog sucks ass for building entire applications. But that hasn't deterred Erlang from stealing it's dynamite syntax. [source: http://damienkatz.net/2008/03/what_sucks_abou.html What Sucks About Erlang]
In reality, syntax just fades away after ~5 minutes of real world usage. As Steve Jobs would say, it's not that big of a deal.
You know all the problems with the ambiguous ; , . stuff that Katz gripes about in that post? Prolog terminates every clause with a period, and all related rules just occur in sequence. Prolog has a read function, much like read in Lisp - "read the next complete (s-expression|Prolog clause) from stdin". The original Erlang compiler needed to read all of the alternative clauses for a function in one go* , so they strung them together with "," and ";", which are Prolog's and and or operators. (They could have fixed this when they started self-hosting, but probably had other priorities.) In practice, it isn't a problem (and Erlang has many perks to make up for those minor syntactic irritations!), but that can't be blamed on Prolog. It's sort of like if you used Lisp's (read) to load more expressions, but since your compiler needed you to read a whole module at once as an implementation detail, you used [ and { pairs instead of parens. Yuck!
In Prolog, that sort of code looks like this:
parent(terach, abraham).
parent(abraham, isaac).
parent(isaac, jacob).
parent(jacob, benjamin).
Note the conspicuous lack of semicolons.* I'm reading between the lines here, so if Robert Virding swoops in and tells me I'm wrong, Hello Robert! :)
If anything, the reason that Prolog isn't good for entire applications is that it's fundamentally a rules/database query language. It's awkward for stateful / procedural code, but if you treat it like (say) a much more sophisticated SQLite, it will be good to you.
I'm still foggy on Erlang, however, and less motivated every time I refer to documentation (but hey, I'm getting paid for it so it kind of evens out).
I appreciate their maintenance of an end delimiter to blocks that is vertically aligned with the start of the block, although they could have gotten a bigger win imo by going with the ALGOL/Ruby style 'end' rather than the C style curly brace (and in doing so freed up curly braces to unambiguously be used for something else).
Arguments on significant whitespace aside, I think that this is one thing that Python got right. (For reference, Python's rules are that ending a line with a backslash will continue a statement, and the same effect will occur automatically if you have a parenthesis, curly, or bracket open.)
I might also be convinced that it would be a good idea to have statement continuation happen if the last token on a line was a binary operator, for the benefit of code like:
if self.foo() and
self.bar() and
self.baz():
do stuff
(Currently PEP 8 requests that you put parentheses around the test.)Go's public/private difference is capitalization of method names. That's hard to scan. Then you get chains that look.Like().A().Mess().
What the Go team seemed to do was take syntax from other languages they were familiar with, ugly syntax non-dynamic languages. They didn't focus on it, Pike said it wasn't important, semantics are important. So when you don't design syntax first, you get a syntax that's on the opposite end from Ruby.
Arguments func([] byte T* blah), who knows what goes where. That needs work.
The c-> and <-c is unintuitive, the syntax is so itsy bitsy it's easy to miss the difference. They should have keywords for that.
And in general the syntax is itsy bitsy, they feel that shorter words means quicker to read, but it's an overreaction to never ending lines commonly found in Java and C++.
I love capitalised public method names. It means I can immediately tell whether a method is public or private, in any context, e.g. on code pasted on HN.
look.Like().A().Mess() looks awful. Don't do it. Or do, it's up to you/ your company's style guide. You could easily avoid chained methods entirely.
Go is at the opposite end from Ruby. It's a systems language... The fact that they look different is no surprise.
func([] byte T* blah) - that's not Go.
send and receive are perfectly intuitive to me. Watch! You put it in the channel<-. You get it out of the <-channel. There is no "->".
"in general the syntax is itsy bitsy" - I can only suggest you try it for a bit longer until you get used to it.
Considering the year elapsed, that's about as likely as them killing the project and admitting that Go is a turd which only gets airwave because it's a project by two extremely famous googlers. The syntax is crap, the type system is garbage, they spend their time reinventing utterly terrible wheels and they've thrown out basically all ideas of safety they could get on fire.
http://i.imgur.com/8ERaf.png
X axis is days (approx) since 11/12/09
Y is % of chars as compared with the busiest day (11/12/09)
I've used the language for big projects and little projects. The strict error handling is fantastic. I like everything about the language except one thing. Just one, and it's a big nasty thing. I hope Russ, Rob, Iant or someone from the development team reads this, because it needs to be said, and others have said it, and it's the reason I stopped programming in go. Go might not need generics, the go development team might not need generics, but I DO! You wonder why there isn't a rocking go web framework? Because generics would be a huge help and no one wants to piece together a tedious solution immediately deprecated by the announcement we've been waiting a year for, "Go is getting generics!" All I want for christmas is generics ... and a pony.http://www.cse.unsw.edu.au/~dons/irc/
Compare also:
http://gmane.org/plot-rate.php?group=gmane.comp.lang.go.gene...
http://gmane.org/plot-rate.php?group=gmane.comp.python.gener...
http://gmane.org/plot-rate.php?group=gmane.comp.lang.haskell...
> We’re also exploring some further additions to the type system to make generic programming easier.