Every language that runs on a real machine has to answer the same short list of questions. Who frees the memory? What happens when an operation has no defined meaning? How does a value cross the boundary into code compiled from another language? How does a structure become a sequence of bytes on a wire? The answers differ sharply, and each answer buys something and costs something else.
This cluster takes one such concern per note and reads it across several languages at once. The theory behind each concern already lives in Programming Language Concepts; these notes are about what the theory turns into when it meets a compiler, a linker, and a network. They lean toward the concerns a systems, networking, or security engineer runs into: the machine contract, the wire, and the trust boundary.
The generics spine
The longest arc here follows one question through eight notes: what happens to a type parameter between the source you write and the machine code that runs. Start with the survey, then take the pieces in order, because each one is a different place the same design decision surfaces.
- Five Answers to the Same Question - the entry point: erasure, reification, monomorphization, GC-shape stenciling, and a runtime contract, as five shipped answers to one definition
- Constraining a Type Parameter - bounds, where clauses, concepts, type sets, trait bounds, and protocols as eight expressive ceilings on what T may do
- Variance, Use Site versus Declaration Site - whether the caller or the library author pays for the subtyping rule, and what changes when it is inferred
- Dispatch, Vtables, Fat Pointers, and Dictionaries - where the method table actually lives, inside the object, beside the pointer, or passed in
- Structural versus Nominal Typing - compatibility by members or by declaration, and why every structural language had to invent narrowing
- Type-Level Computation - conditional types, templates, phased macros, and const generics as four answers to what a compiler should compute before the program runs
- Runtime Type Information - what survives past the compiler, from whole constructed types down to nothing at all
- What Generics Cost to Compile - the bill for all of the above, paid in compile time and binary size
The machine contract
The concerns that exist because the code eventually becomes instructions on a specific machine. Every note here is about a promise the language makes to hardware, an operating system, or another language’s compiler.
- Who Frees the Memory - manual, RAII, reference counting, and tracing GC as four answers to one question
- The C ABI and Foreign Function Interfaces - why C is the lingua franca every language speaks at the boundary
- Undefined Behavior as a Contract - the standard’s silence is the compiler’s optimization license
- Serialization and Wire Formats - turning a struct into bytes without the two ends disagreeing
- Numbers, Overflow, and the Edge of the Type - wrapping, trapping, undefined behavior, and arbitrary precision as four contracts at the edge of a type
- Portability and Cross-Compilation - target triples, ABI defaults, and what makes a binary move between platforms
Runtime behavior
What the program does once it is running, when an operation fails, when two threads reach the same value, or when the text is not ASCII.
- Errors as Values vs Control Flow -
Resultand?versus exceptions, and the honesty-versus-ergonomics tradeoff - Concurrency in Practice - the GIL, Rust’s
Send/Sync, and where each language puts the data-race problem - Text Encoding and What a String Actually Is - bytes, code points, and grapheme clusters, and which layer each language exposes
Compiling and organizing code
How source becomes a unit the compiler and the package manager can both reason about. The first note is the compile-strategy half of the generics spine above.
- Generics, Monomorphization vs Erasure - duplicate per type at compile time, or erase the types and keep one copy
- Module Systems and Namespacing - compile-time trees, textual inclusion, and runtime path search
Toolchain and ecosystem
The concerns that start outside your source tree, where most of the code in a modern program comes from.
- Build Systems and Dependency Management - version resolution, semantic versioning, and what a lockfile guarantees
- Software Supply Chain and Provenance - lockfiles, reproducible builds, SBOMs, and provenance for code you did not write
- Declarative Models and Idempotence - desired-state configuration, idempotence, and Ansible’s declarative surface over imperative Python
The comparative layer is meant to grow. Any concern that several languages must answer, and answer differently, belongs here.