Skip to content
Opensource internals
  • Posts

Runtime

Go's defer and panic: Open-Coded Defers and the Runtime's Unwind Loop

Oct 21, 2026 20 min read Jay Hubbert

Go compiles a defer three different ways depending on where it appears, and the panic runtime unwinds those three shapes separately.

GoInternalsDeferPanicRuntime

Read more →

Go's Generics: Dictionary Passing, Shape Stenciling and GC Shape

Oct 21, 2026 18 min read Jay Hubbert

Generic code is shared per shape, the concrete types arrive in a flat dictionary of machine words, and the shape’s layout is what makes the sharing safe.

GoInternalsGenericsCompilerRuntime

Read more →

Go's Interfaces Are Two Words and a Cached itab

Oct 21, 2026 18 min read Jay Hubbert

Interfaces are two machine words, the itab is usually emitted statically by the compiler, and the runtime keeps a lock-protected hash table for the cases it cannot know.

GoInternalsInterfacesRuntimePerformance

Read more →

GODEBUG: The Knobs Go Gives You to Turn Up the Volume

Oct 21, 2026 19 min read Jay Hubbert

GODEBUG is two mechanisms wearing one name: a table of compatibility settings whose defaults change with each release, and a set of runtime debug knobs, both read from one …

GoInternalsGodebugRuntimeCompatibility

Read more →

How cgo Works in Go: The Two Compilers and a Bit of Magic

Oct 21, 2026 13 min read Jay Hubbert

cgo runs the C compiler to learn C types, rewrites your Go source into Cfunc wrappers, generates matching C glue that passes arguments in a struct, and each call goes through a …

GoInternalsCgoFfiRuntime

Read more →

← Newer Page 1 of 2 Older →

© 2026 Jay Hubbert · Built with Hugo 0.168.0

RSS ·