Programming Languages · Cluster

Metaprogramming

Macros, reflection, and compile-time evaluation.

  1. 01 Token Substitution and Tree Substitution in Macro Expansion Why the C preprocessor rewrites flat token sequences while Lisp macros rewrite parsed forms, and how that choice changes precedence bugs, argument checking, and whether expansion is guaranteed to terminate. foundational · Oct 13, 2026
  2. 02 Macro Hygiene and Identifier Capture How macro expansion causes identifiers to bind in the wrong scope, how gensyms and syntax objects prevent it, and what hygiene costs in equality checks and in generated names. foundational · Jul 12, 2026
  3. 03 Quasiquotation, Unquotation, and Nesting Depth How quasiquote builds template structures with holes, why unquote must match the right quasiquote level, and how the level counter decides which parts of a nested template are evaluated. foundational · Feb 26, 2026
  4. 04 Compile-Time Function Evaluation and Its Limits How a compiler runs ordinary functions during translation, why the interpreter inside the compiler must refuse some operations, and where the boundary between constant folding and program execution falls. intermediate · Jun 22, 2023
  5. 05 Runtime Reflection: Metadata Layout and Dispatch Cost What a class descriptor actually contains, why reflective invocation cannot be inlined, and how annotation lookup and dynamic proxies turn a static call into a table walk. intermediate · Apr 23, 2026
  6. 06 Procedural Macros and the Token Stream Contract What a procedural macro receives from the compiler, why the interface is a flat token sequence rather than a syntax tree, and what that costs in error reporting and incremental compilation. intermediate · Oct 20, 2025
  7. 07 Derive Macros and Structural Recursion Over Type Definitions How a derive macro walks a struct or enum field by field to generate implementations, what generic parameters and lifetimes force on the generated code, and why bound inference goes wrong. intermediate · Aug 15, 2026
  8. 08 Expansion Depth Limits and Token Opacity Why a recursive pattern-matching macro consumes one level of expansion depth per element it processes, how the recursion limit is raised, and why a captured fragment cannot be re-matched by a later pattern. advanced · May 23, 2024
  9. 09 Phase Separation and the Ordering of Compilation Stages Why a macro must be defined before it is used, how phase levels propagate through module dependencies, and what transitive phase shifting costs in compilation work. advanced · Jun 18, 2026
  10. 10 Multi-Stage Programming and Cross-Stage Persistence How staged languages type the distinction between code and its generation, what run and splice mean at each level, and why a value captured at one stage must be embeddable in the next. advanced · Jun 5, 2024