They say Go is a statically typed language with a strong type-safe memory model, an inbuilt garbage collector with strong support for channel-based concurrency.

Why I am interested ?

  • It's touted to be a modern C alternative with inbuilt garbage collection and better memory safety (don't know what exactly it is !!). Go programs run almost as fast as C programs. I've read that Rust comes to as low-level as C.
  • It statically links all dependencies and builds a single binary. Though this increases the binary file's size, it's better for portability (no dependency hell, works on containers too). Can it also do 'dynamic linking' if required ? Should see. Seems a Go program can be compiled for a different target OS than the one on which it's being compiled. Currently it supports Windows, Linux, macOS, and Android.
  • Best known for it's first hand support for concurrency (with the help of go routines, channels).
  • The designers have deliberately avoided pointer arithmetic (how confusing it was for me in C !!) and multiple inheritance (my Python's experience has shown that multiple inheritance is confusing and can often lead to hard-to debug problems).
  • Another interesting thing about a Go program is that it does not compile if we import a package/library (or a function etc) while not using the imported package/library (or whatever) in our program. This feature keeps the binary file contained to the required size and also helps to avoid circular dependencies.
  • Go does not support method overloading. Sad. May be there are other ways of achieving the same or there are better alternatives.
  • Seems, there is an increasing trend to use it for system programming. See kubernetes and docker.

I've developed some prejudice ... it's fast and more modern compared to C.


Published

Category

Go

Tags