Skip to content
Beskid Platform specification

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

Modules and visibility

Platform spec node

Modules and visibility

Spec standingStandard

Owner
Piotr Mikstacki
Submitter
Piotr Mikstacki

Defines the module graph, file-scoped modules, and pub visibility rules. Name binding is in Name resolution.

FormRule
Path modmod a.b; declares the file’s module path; must be the first top-level item when used (E1505, E1506, E1507)
Inline modmod name { items } nests a submodule in the current file
File pathWithout file-scoped mod, module identity must derive from file path relative to project source root
  • Items default to private to their module.
  • pub on an item must export it to importers of the containing module.
  • pub use path re-exports symbols; re-exported names must refer to accessible items.
  • Importing a private item must error (E1501, E1107).
  • Duplicate module declarations in one file must error.
  • Nested mod declarations inside a file-scoped module file must error (E1507).
  • Package boundaries must align with project manifests; cross-package visibility follows the same pub rules within each compilation.

Modules exist at compile time; runtime has no separate module loader beyond linked assemblies/packages produced by the toolchain.

Visibility band E1501–E1507; unused import W1503. Registry: Diagnostic code registry.

L1 implementations must match reference layout tests for file-scoped modules and pub boundaries.

  • D-LM-MOD-001 — File-scoped precedence: Explicit mod path; wins over path-derived module identity when present.
  • D-LM-MOD-002 — No internal keyword: v0.1 uses private-by-default plus pub; assembly-internal friends are deferred.
  • D-LM-MOD-003 — Package graph is external: Cross-package edges come from manifests; this chapter defines symbol visibility only.
  • D-LM-MOD-004 — pub use re-export: Re-exports must preserve the underlying symbol’s accessibility rules.

File layout, public/internal boundaries, and how packages compose. The driver and package manager use the same module graph the typechecker sees.