Sibling articles under this feature previously restated requirements in inconsistent forms.
Typed emitter and transforms - Design model
Platform spec article
Typed emitter and transforms - Design model
Spec standingStandard
-
This feature hub owns normative MUST/SHOULD contract text for Typed emitter and transforms.
Context
Decision
This feature hub owns normative MUST/SHOULD contract text. Sibling articles must not redefine hub requirements and should link here for authority.
Consequences
Contract changes start on the hub or in linked ADRs, then propagate to articles and implementation anchors.
Verification anchors
site/website/src/content/docs/platform-spec/compiler/compiler-mods/typed-emitter-and-transforms/index.mdxarticle bundle under the same feature directory.
-
Platform-spec text supersedes informal crate comments for Typed emitter and transforms.
Context
Implementation crates accumulated informal notes that diverged from published contracts.
Decision
Normative platform-spec prose and ADRs under this feature supersede informal comments in implementation crates until explicitly migrated into spec text.
Consequences
Engineers file spec/ADR updates when behavior changes; crate comments are non-authoritative for conformance arguments.
Verification anchors
compiler/crates/beskid_analysis/src/syntax/items/compiler/crates/beskid_codegen/
-
This feature hub defines the normative contract for **`Beskid.Compiler.Emit`** (typed emitter and transforms) and links
Context
This feature hub defines the normative contract for
Beskid.Compiler.Emit(typed emitter and transforms) and links detailed articles.Decision
The reference compiler must implement Typed emitter and transforms as documented in this feature hub and its article bundle.
Consequences
Changes require hub/ADR updates and verification anchor extensions.
Verification anchors
compiler/crates/beskid_analysis/src/syntax/items/compiler/crates/beskid_codegen/
- Typed emitter and transforms - Contracts and edge cases Construction of syntax nodes and declarative transforms without raw text printing.
- Typed emitter and transforms - Design model Construction of syntax nodes and declarative transforms without raw text printing.
- Typed emitter and transforms - Examples Construction of syntax nodes and declarative transforms without raw text printing.
- Typed emitter and transforms - FAQ and troubleshooting Construction of syntax nodes and declarative transforms without raw text printing.
- Typed emitter and transforms - Flow and algorithm Construction of syntax nodes and declarative transforms without raw text printing.
- Typed emitter and transforms - Verification and traceability Construction of syntax nodes and declarative transforms without raw text printing.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
This article documents the design model for Typed emitter and transforms.
Language alignment
Section titled “Language alignment”Emit applies only typed edits; language-meta forbids raw-text patching as the normative contract.
Persistent entities
Section titled “Persistent entities”- Compilation instance — implicit handle to the compilation under construction (Compiler Mod SDK /
Beskid.Compiler.Compilation). - Syntax snapshot — immutable tree with stable node identities suitable for incremental keys.
- Capability tokens — host-granted permissions for I/O, diagnostics, and emit operations during mod execution.
Boundaries
Section titled “Boundaries”- Mod SDK facades never bypass the host bridge for effects.
- Generation logic in the reference compiler remains Rust-internal; Beskid sees only the generated
Beskid.Compiler.*projection.
Anchored code paths
Section titled “Anchored code paths”compiler/crates/beskid_analysis/src/syntax/items/— patterns for well-formed item emission.compiler/crates/beskid_codegen/— downstream expectations after merge.
Merge model (surface syntax first)
Section titled “Merge model (surface syntax first)”Typed emit must construct or mutate Program-level syntax nodes (or a documented multi-file aggregate feeding the same parser contract), not ad hoc HIR patches. Contributions must pass the same well-formedness checks as user-authored items before merge.
Ordering — Multiple contributors touching the same declaration identity produce a deterministic merge failure surfaced as structured diagnostics; the host must not leave a partially merged tree.
Handoff to lowering — After typed emit commits at syntax.generation and the host emits lower.ready, the merged syntax must be the sole input to lower_normalize_resolve_type_spanned / codegen lowering paths documented in Stage ordering and lowering; lowering must not begin until emit validation succeeds or emit is skipped for that generation round.