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.
The current syntax for a package declaration is this:
The spec doesn't describe the purpose of the
( '/' id )*part, and I think it's misplaced. For instance, inuse 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: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
usestatement could be switched, i.e.use wasi:cli@0.2.0/importsinstead ofuse wasi:cli/imports@0.2.0.