Thoughts on Go
Among the new (or relatively new) languages I keep hearing about, Go is one that has quite a lot of traction, perhaps because is backed by Google itself, so I decided to investigate a bit.
When searching information about it, one of the most common concept you’ll find is about how quick is to learn, especially if you have a C/C++ background. In fact the syntax is pretty similar and Go is using pointers as well.
The following example is based on the one that Tour of Go is presenting :
package main
import "fmt"
func main() {
i := 42
p := &i // point to i
fmt.Println(*p) // read i through the pointer
*p = 21 // set i through the pointer
fmt.Println(i) // see the new value of i
}
On top of this the engineers that wrote the language added an interesting way to manage concurrency, using goroutines, defined as lightweight thread of execution.
I started playing with the language, following the Tour of Go tutorial and here is the repository related to it.