Skip to content

Package declaration syntax clarity #549

@ouillie

Description

@ouillie

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/[email protected].{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:[email protected]/imports instead of use wasi:cli/[email protected].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions