Akhil's Blog Thoughts, Ideas, Essays & Views

Golang Learning Levels

This is a post for helping developers to go deeper into golang

Background

To build deep expertise on any programming language, one needs to study the language at three levels (increasing in depth) and then only the nuances of the language are understood well to effectively use the language & have good grip on the language.

Coming from Erlang background, it’s very interesting to see some of the features in golang being inspired from Erlang or some evolving towards those in Erlang like

  • Scheduling in golang has moved from cooperative to preemptive scheduling from v1.2
  • Message passing and process distribution - this is still not as flexible as erlang
  • Supervision trees for fault tolerance

During discussions with the team, I thought it would be useful to list down links to learn golang at each level.

Constructs & Language Design

This is the first and basic level where focus is on learning the constructs provided by language starting from syntax to semantics and then looking at the overall language design. Some of the constructs may be for declarative programming (macros, annotations), procedural programming (first order functions, loops, conditions), oop (type, inheritance, polymorphism, generics, reflection), functional programming (closure, higher order functions, pattern matching, list comprehensions), concurrent programming (light weight processes, message passing, process distribution), fault tolerance (supervision, hot reloading). Some useful links to start on Golang constructs & language design learning.

Evolution & Philosophy

Language evolution and philosophy are important to know and understand, this builds the context in which programming language has been developed which then helps to understand in depth the correct way of using language as well as its limitations and strengths. Golang being opensource helps in looking at the evolution of the language & learn from various design decisions taken.

Compiler & VM Internals

The way language and various constructs operates or are implemented in the VM, this gives good view of VM for doing tuning, optimisation and knowing internals like following

  • Go concurrency using goroutines - scheduling, sandboxing, message passing, distribution across nodes, csp (communicating sequential process)
  • Go memory management - garbage collection, stack vs heap memory, manual memory management, immutable vs mutable, shared memory
  • Go io management - various io management features like buffered io, non-blocking io
  • Go grammar and compiler - looking at the grammar (syntax and semantics), compilation and symbolic tree

Few links to start on the golang internals

General

Few links below have very good content across all levels