Hacker News new | ask | show | jobs
by elimisteve 5139 days ago
I also use Go. Roughly 80% of the code I write is still Python (Django apps), but there are times when Go just makes the most sense... so that's what I use.

Whenever speed is key, I use Go. Its concurrency primitives are dead simple. It has excellent support for cutting-edge technologies like WebSockets and SPDY (these libraries/"packages" were written by Google), as well as MongoDB (see "mgo").

I'm using Go in production (for an almost-complete MVP). For a telephony app I had to dial 100 simultaneous phone numbers to bring people into conference calls. Trying that in Python maxed out my EC2 instance's resources. I had to kill and restart it from the AWS web interface.

Then I rewrote that part in Go. I was staring at the output of htop (similar to top) when it ran and thought something was wrong; it used a few megs of RAM, no noticeable CPU, and finished in 0.59 seconds _on a micro instance_. Now you can see why Google wanted such a language!

I never appreciated static typing ("who wants to go from Python to Java or C++?") until Go, which makes very heavy use of type inferencing. The upshot is you'll find yourself declaring types 0 times instead of twice in Java. In Python and Ruby you don't declare them at all, resulting in type errors _all over the place_ and programs that run ~20 times slower; see http://shootout.alioth.debian.org/u64q/benchmark.php?test=al....

The Go compiler tells me which lines contain the type errors. Usually my program is correct once these errors are gone. Can't say the same for Python, whose apps can run for days before a corner case is hit, exposing a type error that would've been caught at compile time in Go.

It's interesting that you mentioned Clojure. Well, it's powerful alright, but I found it to be extremely complicated (does a language _really_ need 4 kinds of concurrency and to consist of literally 500 functions?)

If you believe as I do -- as do most who appreciate small, simple, but extremely powerful languages like Python and C -- that simplicity is a feature, you will love Go. If you love Java, C++, D, and other huge languages, consider those or something like Scala or Clojure instead. IMO, doing so means giving up clarity/comprehensibility for a longer list of features, almost all of which _can_ be useful, but all of which make mastering the language much more difficult.

Go has been my favorite language for about a year now. Its only weakness is lack of library and/or framework support, which is an occasional bummer.

That said, I very strongly recommend giving Go a try if you haven't already. I played with Clojure for months till it finally made sense and I saw how powerful it _could_ be, but I still couldn't do anything with it that I couldn't do in Python.

After 2 hours with Go (1.5 years ago), I wrote my first ever concurrent program... _trivially_. This can not be stressed enough. Want a function call to `f` to be non-blocking? Type `go f()`. Yes, it's that simple. Launch a couple functions like that, and bam, you're doing extremely efficient concurrent programming.

If you want the convenience of Python or Ruby plus the speed and type safety of C++, give it a shot! http://golang.org