chapter one

1 The Problem Go Was Built to Solve

 

This chapter covers

  • The problem Go was built to solve: the 2007 origin and the five design goals
  • Fast compilation and type safety: how Go makes the compiler a productivity tool
  • Efficient execution: native performance, managed memory, and self-contained deployment
  • Concurrency built in: goroutines, channels, and context as language primitives
  • Simplicity by design: composition, interfaces, and a deliberately small language
  • World-class tooling: the standardized toolchain that ships with every Go installation

Go is a language that rethinks several assumptions that have governed mainstream programming for decades. Where most languages treat concurrency as a library problem, Go makes it a language primitive. Where most languages force a choice between fast compilation and a strong type system, Go delivers both. Where most languages leave tooling to the ecosystem, Go ships a complete, standardized toolchain with every installation.

This chapter examines the decisions that shaped Go and the problems those decisions were designed to solve. You will come away with a clear mental model of why Go looks the way it does: why it has no classes, why its compiler is so fast, why goroutines are cheaper than threads, and why the standard toolchain exists. Understanding the why makes the what much easier to use well.

1.1 The Problem Go Was Built to Solve

1.2 Fast Compilation and Type Safety

1.2.1 Development Speed

1.2.2 Type Safety

1.3 Efficient Execution

1.4 Concurrency Built In

1.4.1 Goroutines

1.4.2 Channels and Context

1.4.3 A Request’s Lifecycle

1.5 Simplicity by Design

1.5.1 Composition Over Inheritance

1.6 World-Class Tooling

1.7 What This Book Covers

1.8 Summary