Contemporary Computer System Design
Go
encourages an awareness of contemporary computer system design,
particularly the importance of locality.
- Its built-in data types and most library data structures
- are crafted to work naturally without explicit initialization or
implicit constructors,
- so relatively few memory allocations and memory writes are hidden in the
code.
- Go’s aggregate types (structs and arrays)
- hold their elements directly,
- requiring less storage and fewer allocations and pointer indirections
than languages that use indirect fields.
- And since the modern computer is a parallel machine,
Go
has concurrency
features based on CSP
, as mentioned earlier.
- The variable-size stacks of Go’s lightweight threads or goroutines
are initially small enough that creating one goroutine is cheap and
creating a million is practical.