Golang Learning Levels
23 Apr 2021Background
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 & get 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.
- Golang Syntax
- Go - Good, Bad & Ugly
- Go - Pike Abstract
- Go Koans
- Some Thoughts On Library Design
- Domain Driven Design in Go
- Functional Go
- Golang Developer Roadmap
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.
- Golang Design History
- Go at Google - Language Design
- Towards Go 2
- The laws of reflection
- The value in Go’s simplicity
- Message passing designs - Actor/Light Weight Process vs CSP (Communicating Sequential Process) vs MPI
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
- Golang Garbage Collection
- Golang Internals
- Memory Management In Golang
- Journey of Go’s Garbage Collector
- Scheduling In Go
- Go Scheduler
- Cooperative to preemptive scheduling - Non-Cooperative Preemption, Manual Memory Management In Golang
General
Few links below have very good content across all levels