Why invest in golang:
-
Example of successful projects: docker, kubernetes, docker, kubernetes, influxdb, etcd, syncthing?
-
Fast: benchmark game, TechEmpower
-
Good for the planet - Low Energy Usage
-
Concurrency is a Joy in this language. Moore's law.
-
Popular Enough for Rich Ecosystem
- IEEE Spectrum 2018 - Go 9th
- IEEE Spectrum 2019 - Go 10th
- StackOverflow 2019 Developer Survey - Go 13th
- redmonk language rankings - Go 16th
- PYPL - Go 15th
- TIOBE Index - Go 11th
- Githut Pull Request info - Go 4th
- Google Trends
- StackOverflow Trends
-
Simple and Productive
-
Maintaining someone else's code is a pleasure in Golang.
Energy | Time | Mb |
---|---|---|
C 1.00 | C 1.00 | Pascal 1.00 |
Rust 1.03 | Rust 1.04 | Go 1.05 |
C++ 1.34 | C++ 1.56 | C 1.17 |
Ada 1.70 | Ada 1.85 | Fortran 1.24 |
Java 1.98 | Java 1.89 | C++ 1.34 |
Pascal 2.14 | Chapel 2.14 | Ada 1.47 |
Chapel 2.18 | Go 2.83 | Rust 1.54 |
Lisp 2.27 | Pascal 3.02 | Lisp 1.92 |
Ocaml 2.40 | Ocaml 3.09 | Haskell 2.45 |
Fortran 2.52 | C# 3.14 | PHP 2.57 |
Swift 2.79 | Lisp 3.40 | Swift 2.71 |
Haskell 3.10 | Haskell 3.55 | Python 2.80 |
C# 3.14 | Swift 4.20 | Ocaml 2.82 |
Go 3.23 | Fortran 4.20 | C# 2.85 |
Dart 3.83 | F# 6.30 | Hack 3.34 |
F# 4.13 | JavaScript 6.52 | Racket 3.52 |
JavaScript 4.45 | Dart 6.67 | Ruby 3.97 |
Racket 7.91 | Racket 11.27 | Chapel 4.00 |
TypeScript 21.50 | Hack 26.99 | F# 4.25 |
Hack 24.02 | PHP 27.64 | JavaScript 4.59 |
PHP 29.30 | Erlang 36.71 | TypeScript 4.69 |
Erlang 42.23 | Jruby 43.44 | Java 6.01 |
Lua 45.98 | TypeScript 46.20 | Perl 6.62 |
Jruby 46.54 | Ruby 59.34 | Lua 6.72 |
Ruby 69.91 | Perl 65.79 | Erlang 7.20 |
Python 75.88 | Python 71.90 | Dart 8.64 |
Perl 79.58 | Lua 82.91 | Jruby 19.84 |
Le Stum says the strength of Go include its built-in tooling, quick compile times and deploys, and easy troubleshooting, as well as the way it makes code easy to understand. "In Python, you could write super-elegant list comprehensions and beautiful code that's almost mathematical. But if you didn't write the code, then that elegance can come at the expense of readability," he explains, noting that in enterprise software, engineers spend more time reading code than writing it.
—Salesforce principal architect Guillaume Le Stum
You can make go source code executable like this:
///usr/bin/env go run "$0" "$@" ; exit "$?"
package main
func main() {
println("Hello world!")
}
Then I can just chmod a+x hello.go
and execute ./hello.go
. More options at https://gist.github.com/posener/73ffd326d88483df6b1cb66e8ed1e0bd
Unix pipes are awesome. Go scripts can use them like one of these:
- https://github.com/bitfield/script
- https://labix.org/pipe aka https://github.com/go-pipe/pipe
- https://github.com/progrium/go-shell
- https://coderwall.com/p/zyxyeg/golang-having-fun-with-os-stdin-and-shell-pipes
- https://flaviocopes.com/go-shell-pipes/
- http://www.albertoleal.me/posts/golang-pipes.html
This is an interesting way to package multiple scripts into one directory: https://github.com/jpignata/toolbox
- https://godoc.org/?q=slack (search Go Doc)
- https://go-search.org
- https://www.grank.io/
- https://github.com/avelino/awesome-go
- https://github.com/search?l=&p=1&q=language%3AGo+stars%3A%3E1000&ref=advsearch&type=Repositories&utf8=✓
- Finding Dependable Go Packages - https://www.youtube.com/watch?v=zCragLHzP1Y