15. Mods: plugins with consequences
Compiler mods—Collector, Generator, Analyzer, Rewriter—and the AOT-only host pipeline.
Mods: plugins with consequences
Mods are plugins with consequences: they mutate the compile graph, re-parse generated AST, and can fail closed with E18xx diagnostics before your app code runs. The compiler itself stays Rust; your extension is Beskid type: Mod plus AOT artifacts.
Normative Beskid surface: Compiler Mod SDK. Host law: Compiler mods and Mod host bridge.
What you will find here
Section titled “What you will find here”| Section | Topic |
|---|---|
| What is a mod | Project kind, discovery, boundaries. |
| Mod SDK | Contracts, Syntax mirror, query DSL. |
| Generator, Analyzer, Rewriter | Roles and ordering. |
| beskid mod CLI | Build and wire mod packages. |
| Pipeline phases | collect → generate → analyze → rewrite. |
Start here
Section titled “Start here”After this chapter
Section titled “After this chapter”Return to book reference for CLI details, or read Implementation map when filing spec+crate changes.