Phase 3: Golang Low-Level Learning
1. Introduction
Objective: Understand Gos low-level capabilities.
Prerequisites: Solid understanding of basic Go syntax, data types, and interfaces.
2. Memory Management in Go
- Stack vs Heap allocation
- Garbage Collection
How Gos GC works
How to reduce GC pressure
- Escape Analysis
Use `go build -gcflags="-m"` to inspect
- Unsafe Package
Pointer arithmetic
Bypassing type safety
3. Concurrency Internals
- Goroutines
How goroutines are scheduled (M:N model)
Stack growth
- Channels
Blocking & buffering
Select statements
- sync Package
Mutex, RWMutex
Phase 3: Golang Low-Level Learning
WaitGroup, Once
- Atomic Operations
`sync/atomic` usage
Low-level synchronization
4. System Programming
- File Descriptors & I/O
`os`, `syscall`, `bufio`
- Signals and Process Management
Using `os/signal`, `os/exec`
- Interfacing with C
`cgo` basics
Calling C libraries
- Network Programming
Low-level TCP/UDP using `net` & `syscall`
5. Profiling and Performance
- pprof
CPU, memory, goroutine profiling
- Benchmarking
Writing and interpreting `testing.B` benchmarks
- Tracing
`runtime/trace`
Phase 3: Golang Low-Level Learning
6. Compiler and Toolchain Insights
- Go build process
Source SSA Machine code
- Linker and Loader
- Using `go tool compile` and `go tool objdump`
7. Practical Projects
- Memory allocator in Go (with `unsafe`)
- Mini-shell using `os/exec` and pipes
- Profiling a concurrent HTTP server
8. References & Further Reading
- Official Go Blog
- Go Source Code (https://github.com/golang/go)
- "The Go Programming Language" by Alan Donovan & Brian Kernighan