Wado

WEP: Symbol Notation

Context

Wado needs one official, written way to name "this symbol in this module" — for docs, wado query, and diagnostics. The hard part is that a module reference is heterogeneous: a scheme (core:json), a relative path (./utils.wado), a remote URL (https://x/lib.wado, not yet implemented), or a bare dependency name (parser-lib). These already contain :, /, ., and #, so the module/symbol boundary must be unambiguous.

The compiler already has an internal canonical name (wado-compiler/src/name.rs): module and symbol joined by /, members by ::, trait impls by ^. That / join is ambiguous against paths and URLs, so it is unfit as a user-facing notation.

Decision

A symbol is written MODULE # SYMBOL.

Quoting: MODULE is quoted as in import, but the quotes may be omitted when unambiguous — i.e. for schemes and bare dependency names with no whitespace. Relative paths and URLs must be quoted, since they contain #, /, and ..

core:json#parse                          # free function (unquoted scheme)
core:math#f64::PI                        # associated constant
core:collections#TreeMap::new            # associated/static function
core:collections#TreeMap.insert          # instance method
core:collections#List<String>::len       # generics, Wado angle brackets
core:fmt#Point^Display::fmt              # trait-impl member (^ as internally)
"./utils.wado"#Helper::new               # relative path, quoted
"https://x/lib.wado"#foo                  # URL, quoted

Two registers, one grammar:

Consequences

Implementation

The notation is a textual locator orthogonal to the position locator (--line/--column): every wado query kind can, in principle, accept either. Resolution loads the module named in the notation and looks the symbol up by name, so no entry file is needed — relative modules anchor at --base (default .), while core: / wasi: are location-independent.

Name-based results are bounded by what the analysis loads. references loads the whole --base workspace by default (every .wado under it) so it spans sibling files; definition / hover / document-highlight load only the target module's import graph.

TODO