Why
Racket separates surface syntax (macros, convenient forms) from a core language with well-defined semantics.
Programs are expanded (desugared) before evaluation.
Core vs Surface
- Surface: rich syntax via macros, domain-specific extensions.
- Core: a small set of forms with precise semantics (easy to reason about).
Desugaring pipeline
Source (surface) → macro expansion → Core forms → evaluation
Tiny desugar example (schematic)
(when c e) ⇒ (if c (begin e) (void))
Notes
- Macro expansion runs before evaluation.
- Reasoning about programs happens at the core level; surfaces are convenience layers.
See also