Go is a programming language initially developed by Google in 2007. It is a statically typed language with a simple syntax, resembling C or JavaScript. It features garbage collection, type safety and large standard library.
Go can be statically compiled into a single executable binary, which could target a large number of operating systems (from Linux and Windows to Plan 9) and processors (i386, amd64 and ARM).
Note
|
In HappyPancake project we found that Golang was a good fit for developing event-driven backend services. Other contenders included Scala, C#, Haskell and Erlang. |
-
Concise and simple syntax, easy to get started with.
-
Good facilities for writing concurrent programs that share state by communicating (goroutines and channels).
-
Good ecosystem for developing backend servers, all major drivers and libraries are available.
-
Decent integration story with native code.
-
Lightweight development stack with major IDE-like features provided by command-line tools (and available in different editors).
-
Unified formatting style for the language, provided by
gofmt
. -
Compilation is fast even with large projects.
-
Go supports all major OSes and CPU architectures.
-
You must set and tweak
GOMAXPROCS
variable for each program which needs parallel execution. -
You can build web applications and native UIs with Golang, but ecosystem there is rather immature, if compared to the other platforms.
-
Debugging golang code is neither easy nor reliable.
-
Golang has prominent explicit error handling style; if followed blindly, it can turn code into a spaghetti of error checks.
-
Golang stores all dependencies as folders in
GOPATH
, e.g.abdullin/chk
. Having a single global workspace makes things tricky, when you need to work with multiple versions of a library.
Note
|
This is the state of Golang at the moment of writing. Things will improve over time. |