WebAssembly / WebAssembly/component-model
Consistent version syntax
Nobody has claimed this yet.
- Dominant language
- WebAssembly
- Stars
- 1.4k
- Forks
- 130
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 15
Description
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/types@0.2.0" (instance (;0;) (type 0)))
These lead me to sometimes be confused about whether to say wasi:http@0.2.0/types.{incoming-request} or wasi:http/types@0.2.0.{incoming-request}. I've been trying to get used to it by telling myself that package wasi:http@2.0.0; 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 types@0.2.0 { isn't valid in WIT, and I don't expect it ever will be.
And, wasi:http/types@0.2.0.{incoming-request} suggests a misleading mental model, as if wasi:http were a thing that gets looked up without a version, and then types@0.2.0 is a versioned thing to look up inside that.
Additionally, types@0.2.0.{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:http@0.2.0/types.{incoming-request} form, pre-1.0 when we have an opportunity to make a breaking change.
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
Read the linked WIT package and use sections, then compare them with the linked import and export definitions in the Explainer. Trace the package, use-statement, and import/export examples and determine whether the proposed version placement can be applied consistently; done means the affected syntax and documentation agree on one form.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- wasm
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100