What Go Does
- Compiled — fast native binaries, cross-compile
- Garbage collected — low-pause GC optimized for latency
- Static typing — with type inference via
:= - Goroutines — cheap concurrent functions (thousands per MB)
- Channels — CSP-style communication between goroutines
- Interfaces — structural typing, no inheritance
- Standard library — HTTP, crypto, JSON, SQL all in stdlib
- Tooling — go fmt, vet, test, doc, mod built in
- Modules — dependency management since Go 1.11
- Generics — since Go 1.18
Architecture
Compiler (gc) written in Go itself, plus gccgo alternative. Runtime manages goroutine scheduler (M:N mapping to OS threads), memory allocator, and garbage collector. Single static binary output — no DLL hell.
Self-Hosting
Language toolchain. Installs via official installer or package manager.
Key Features
- Single static binary output
- Lightning-fast compilation
- Cross-compilation (GOOS/GOARCH)
- Goroutines + channels
- Rich standard library
- go fmt canonical formatting
- Comprehensive tooling (test, vet, doc)
- Generics (since 1.18)
- Fuzzing (since 1.18)
- Workspaces for multi-module dev
Comparison
| Language | Concurrency | Compilation | GC | Typical Use |
|---|---|---|---|---|
| Go | Goroutines/CSP | Fast | Yes | Cloud infra |
| Rust | Async + threads | Slow | No (ownership) | Systems |
| Java | Threads + Project Loom | Medium | Yes | Enterprise |
| Python | asyncio | Interpreted | Yes | Scripts, ML |
| C++ | Threads + coroutines | Slow | No | Performance |
| Node.js | Event loop | JIT | Yes | Web APIs |
FAQ
Q: Is Go good for web development? A: Very suitable. The standard library has a complete HTTP server, plus frameworks like Gin, Echo, Fiber, and Chi. Go is also a top choice for microservices and gRPC backends.
Q: When were generics added? A: Go 1.18 (March 2022). Before that, you had to rely on interface{} or code generation; now you can write truly type-parameterized functions and types.
Q: Difference between goroutines and OS threads? A: Goroutines are user-space coroutines managed by the Go runtime, with an initial stack of 2KB (vs 1-8MB for OS threads). The scheduler multiplexes goroutines M:N on OS threads, so you can easily spawn millions.
Sources
- Docs: https://go.dev/doc
- GitHub: https://github.com/golang/go
- License: BSD 3-Clause