WebAssembly / WebAssembly/component-model
Package declaration syntax clarity
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
The current syntax for a package declaration is this:
package-decl ::= 'package' ( id ':' )+ id ( '/' id )* ('@' valid-semver)?
The spec doesn't describe the purpose of the ( '/' id )* part, and I think it's misplaced. For instance, in use wasi:io/streams@0.2.6.{output-stream};, the slash comes after the package name and is used to denote a sub-package resource (an interface). A package declaration should probably be this:
package-decl ::= 'package' ( id ':' )+ id ('@' valid-semver)?
If there's something important I'm missing, then it's missing from the spec.
I might also chime in that I think the version and sub-resource components of a use statement could be switched, i.e. use wasi:cli@0.2.0/imports instead of use wasi:cli/imports@0.2.0.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the package-decl grammar in the specification and compare it with the use wasi:io/streams@0.2.6.{output-stream} example. Clarify whether slash-separated identifiers belong in package declarations, then update the grammar and explain the syntax; resolve the proposed ordering question for use statements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100