5.5 KiB
5.5 KiB
PBS Name Resolution Workshop 4
Status: Active
Purpose
Run the fourth focused discussion for 14. Name Resolution and Module Linking Specification.md on phase ownership:
- what belongs to syntax,
- what belongs to static semantics,
- what belongs to module/linking,
- and whether PBS keeps linking as a distinct normative phase at all.
Why This Slice Last
This slice should come last because it is mostly a boundary-setting exercise over decisions already made in Workshops 1 through 3.
Trying to close it earlier would force abstract phase arguments before the actual failure classes were concrete.
Proposed Meeting Order
- Reconfirm the concrete failure categories identified in earlier workshops.
- Group those failures by source-only, module-resolution, and cross-module visibility concerns.
- Decide whether PBS names linking as a distinct normative phase.
- Decide how this boundary feeds diagnostics, conformance, and frontend implementation claims.
- Record any residual editorial cleanup for the spec integration pass.
Failure Classes To Sort
This workshop should explicitly sort at least the following classes:
- malformed import syntax,
- unresolved module path,
- import of non-exported symbol,
- duplicate local declarations,
- ambiguous imported names,
- callable-set ambiguity across modules,
- builtin-receiver member lookup failure,
- duplicate canonical builtin or host identities in one resolved environment,
- and barrel entries that fail to resolve against module declarations.
Decisions To Produce
- Whether linking is a distinct normative phase in PBS v1.
- Ownership of the major failure classes already identified.
- The minimum phase vocabulary needed by diagnostics and conformance.
- The frontend implementation consequences of the chosen phase model.
Candidate Decisions
1. Keep Linking As A Distinct Normative Phase
Candidate direction:
- syntax owns grammar and token-shape failures,
- static semantics owns declaration validity, typing, and callsite selection,
- linking owns cross-file and cross-module visible-set formation and barrel/import matching.
Rationale:
- This gives a clean home to failures that are neither purely syntactic nor ordinary local typing.
- It matches the practical compiler architecture implied by module loading and barrel visibility.
- It gives
11and13a usable phase vocabulary.
Alternative to discuss:
- collapse linking into static semantics and treat "linking" only as an implementation detail.
2. Module-Visibility And Import Failures Belong To Linking
Candidate direction:
- unresolved exported-name lookup after the target module is loaded belongs to linking,
- ambiguous imported visible names belong to linking,
- callable-set ambiguity across modules belongs to linking,
- and unresolved barrel entries belong to linking or module-linking rather than to syntax.
Rationale:
- These failures arise from assembling visible declarations across files or modules, not from parsing isolated declarations.
3. Callsite Selection Remains Static Semantics
Candidate direction:
- once visible callable sets are formed, overload resolution at a callsite remains static semantics,
- member lookup driven by the known receiver type also remains static semantics unless it fails earlier due to unresolved imported shell visibility.
Rationale:
- This keeps typing and callable selection together.
- It prevents linking from becoming a catch-all bucket for any failure that mentions imports.
4. Diagnostics And Conformance Need Only A Small Stable Vocabulary
Candidate direction:
- the minimum normative phase vocabulary is: syntax, static semantics, manifest/import resolution, linking, and host-binding/capability admission.
- tools may subdivide internally, but they should map back to that stable external vocabulary.
Rationale:
- This is enough for source-facing determinism without overfitting to one compiler pipeline.
Questions To Resolve In The Room
- Is there real value in naming linking as its own normative phase, or does that add conceptual weight without enough payoff?
- Should unresolved barrel entries be considered module-internal static invalidity or linking invalidity?
- Should builtin-receiver member lookup failure always stay in static semantics once receiver type is known?
- Do diagnostics and conformance need the word
linking, or only a broaderresolutionbucket? - Does the chosen phase model help or hinder future lowering and verifier specs?
Expected Outputs
This workshop should produce:
- a decision record for the PBS phase model around name resolution and linking,
- a sorted matrix of failure classes by phase,
- a concrete update plan for
14, - and explicit follow-ups for
11and13.
Explicit Deferrals
The following topics should be deferred unless unavoidable:
- detailed diagnostic code design,
- artifact-level failure surfacing,
- verifier and loader phase internals,
- and optimizer or backend pipeline naming.
Inputs
docs/pbs/specs/11. Diagnostics Specification.mddocs/pbs/specs/13. Conformance Test Specification.mddocs/pbs/specs/14. Name Resolution and Module Linking Specification.mddocs/pbs/agendas/14. Name Resolution and Module Linking Agenda.mddocs/pbs/agendas/14.1. Name Resolution Workshop 1 - Scope, Lookup, and Imports.mddocs/pbs/agendas/14.2. Name Resolution Workshop 2 - Builtin Shells and Host Owners.mddocs/pbs/agendas/14.3. Name Resolution Workshop 3 - Callable Sets and Cross-Module Linking.md