Vol 9: Language Internals
Saying “this variable did not change” requires different evidence for immutable objects, shared references, and concurrent programs. This volume compares types, memory management, concurrency, functional abstractions, the JVM, and DSLs. Language rankings can wait while we work out what the program actually guarantees.
Prerequisites
- Know functions, objects, generics, and exceptions. Review Programming Basics where needed.
- Understand the basic models of stacks, heaps, threads, and synchronization. Use Computer Systems for the machine-level background.
Coverage
The first two chapters distinguish type rules, runtime storage, and inter-thread memory models. Chapters 3 and 4 compare concurrency and functional organization; Chapters 5 and 6 examine implementations through the JVM and metaprogramming.
Chapter 1
- 1.1 Types, Subtypes, and Polymorphism: What Programs Can Do
- 1.2 Generics and Type Variance: Producers, Consumers, and Runtime Representation
- 1.3 Algebraic Data Types and Type Inference: Making State Space Visible
Chapter 2
- 2.1 Runtime Storage: Stack Frames, Objects, Value Semantics, and Escape
- 2.2 Memory Management: Tracing GC, Reference Counting, and Ownership
- 2.3 Language Memory Model: Atomicity, Visibility, and Happens-Before
Chapter 3
- 3.1 Shared Memory Concurrency: Locks, Atomic Operations, and Invariants
- 3.2 Message Concurrency: Actors, Channels, and Backpressure
- 3.3 Task Concurrency: Async, Structured Concurrency, and STM
Chapter 4
- 4.1 Pure Functions and Immutable Data: Control Change First
- 4.2 Higher-Order Functions and Composition: Turning Control Flow into Data
- 4.3 Algebraic Abstraction and Side Effects: From Monoid to Monad
Chapter 5
- 5.1 Class Files and Stack Frames: Understanding javap Output
- 5.2 Loading, Linking, and Invocation: From Symbolic References to invokedynamic
- 5.3 JIT, Deoptimization, and Observability: From Bytecode to Machine Code
Chapter 6
- 6.1 Compile-Time Metaprogramming: Macros, Annotation Processing, and Code Generation
- 6.2 Runtime Metaprogramming: Reflection, Decorators, and Class Creation
- 6.3 DSL Design: Syntax, Semantics, Tooling, and Security Boundaries
Outcomes
- Explain variance constraints from reading and writing requirements, and identify invalid substitutions.
- Distinguish object lifetime, memory visibility, and program invariants, then choose the relevant management or synchronization mechanism.
- Use bytecode, runtime observations, or a small DSL to explain an abstraction’s behavior, costs, and input boundaries.
How to use this map
For each language mechanism, write down its guarantees and try a minimal example plus a failure case. Read the JVM chapters in the order of class files, loading and calls, then JIT compilation. Other language snippets compare mechanisms; prepare the toolchain named in each lesson before running them.