Skip to main content

Crate bynk_model

Crate bynk_model 

Source
Expand description

bynk-model: the Bynk system model. It is the resolved description of what a Bynk program is at the level of declarations: service protocols, handler kinds and routes, type shapes, store fields, capability and attached-fn signatures, given references, actor seams and event subscriptions. Every tool that needs those facts reads them here, not from the AST.

This is distinct from bynk_check::project_model, which models units and manifests, not declarations.

The model sits above bynk-check (crate-hygiene B4, #3012). Its boundary half, bynk_check::wire::WireModel, stays in bynk-check because the checker’s own boundary checks read it.

Three modules, all re-exported at the root:

  • vocabulary: the model’s items (until crate-hygiene B1, #2939, the bynk-ir crate).
  • lower: the builder from a checked program to those items (until B1, the bynk-lower crate).
  • entry: the entry handlers’ signatures, described structurally for a host such as the playground (until crate-hygiene B3, #2999, bynk_check::entry_signature).

The system-model ADR (crate-hygiene track §6, design/archive/retired-tracks.md) records the scope, the requirements every item is held to (M-1 one source per fact, M-2 total over certified programs, M-3 a reader outside the model, M-4 no new AST embedding) and what the model is not: not an expression IR, not the emit ABI, and not a second checker.

Re-exports§

pub use entry::*;
pub use lower::*;
pub use vocabulary::*;

Modules§

entry
#2695: the signatures of a unit’s entry handlers - every on call(...) of a service - described structurally from the checker’s resolved types, so a host (the playground’s Arguments row) never re-parses the source to learn what a run can be passed.
lower
bynk_model::lower (the bynk-lower crate until crate-hygiene B1, #2939): the model’s builder, the AST-analysis helpers bynk-emit reads resolved declaration-level facts through — handler kinds and given clauses, service protocols, store-field shapes, capability op and attached-method signatures, route cache/limit annotations, event-subscriber shapes, and the store-write walk behind emit_agent’s implicit-commit decision. Each takes a checked program (or its TypedCommons) and a syntax-tree node and returns a crate::vocabulary value; none lowers an expression body.
vocabulary
bynk_model::vocabulary (the bynk-ir crate until crate-hygiene B1, #2939): the resolved declaration-level vocabulary the model’s readers (the emitter, the editor’s analysis, the CLIs) get through the builder, crate::lower, instead of re-deriving the same facts from bynk_syntax::ast a second time.