Skip to content

Consistent version syntaxΒ #573

@sunfishcode

Description

@sunfishcode

Currently, WIT package names put the version after the package name:

package wasi:http@2.0.0;

However, WIT use statements and similar things put the version after the interface:

use wasi:http/types@0.2.0.{incoming-request};

Similarly, import/export strings also put the version after the interface:

(import "wasi:http/[email protected]" (instance (;0;) (type 0)))

These lead me to sometimes be confused about whether to say wasi:[email protected]/types.{incoming-request} or wasi:http/[email protected].{incoming-request}. I've been trying to get used to it by telling myself that package wasi:[email protected]; is syntax-sugar for adding the version explicitly to all of the contained interfaces, but I still get confused. It doesn't help that interface [email protected] { isn't valid in WIT, and I don't expect it ever will be.

And, wasi:http/[email protected].{incoming-request} suggests a misleading mental model, as if wasi:http were a thing that gets looked up without a version, and then [email protected] is a versioned thing to look up inside that.

Additionally, [email protected].{incoming-request} is awkward with a . immediately after the .-separated semver syntax, looking to a first glance like it might be part of the version.

I propose changing WIT and components to use the wasi:[email protected]/types.{incoming-request} form, pre-1.0 when we have an opportunity to make a breaking change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions