Use semicolons as delimiters in WIT text format#249
Merged
lukewagner merged 1 commit intoWebAssembly:mainfrom Sep 25, 2023
Merged
Use semicolons as delimiters in WIT text format#249lukewagner merged 1 commit intoWebAssembly:mainfrom
lukewagner merged 1 commit intoWebAssembly:mainfrom
Conversation
This commit commit is an implementation of WebAssembly#142 where semicolons are now required as delimiters between items in the WIT text format. All items in the WIT format are now delimited with either curly braces (`{}`) or semicolons except for the `package` statement where it subjectively felt a bit weird to require a semicolon. I've updated the various examples in `WIT.md` as an example of the new syntax. My plan on implementing this would be along the lines of: * Implement the semicolon syntax in `wit-parser` * Add a parser mode which requires semicolons. This means that the same `wit-parser` crate can either or either not require semicolons. * Update all tests in the `wasm-tools` repository to require semicolons. * Publish `wit-parser` and `wasm-tools`, integrating the semicolon-supporting-mode into all existing tools. * Wait for Wasmtime to get published with this support. At this point everything in the ecosystem should have a point where semicolons are optionally supported. * Remove the parser mode which doesn't require semicolons, meaning semicolons are now required. * Push this update through the tooling, fixing any issues that arise. The hope is to create a period of time where both syntax forms are accepted. This provides a transitionary means from one syntax to the other while proposals are updated. This transitionary period is finite in length, however. Closes WebAssembly#142
This was referenced Sep 19, 2023
lukewagner
approved these changes
Sep 19, 2023
Member
lukewagner
left a comment
There was a problem hiding this comment.
Thanks for writing this up! Agreed this is probably the right answer when we think long-term. lgtm, but I'd be interested to wait for a bit to collect other feedback.
Collaborator
Author
|
I've got a PR for an implementation of this when it's ready at bytecodealliance/wasm-tools#1212 which can also serve as a means to evaluate the aesthetics of the change via reading all the changes to tests. (aesthetics improved IMO) |
Member
|
Looks like no disagreement, so merging. |
alexcrichton
added a commit
to alexcrichton/component-model
that referenced
this pull request
Sep 27, 2023
This is a follow-up to WebAssembly#249 and discussion in today's component model meeting to require semicolons after the `package` statement to ensure it's consistent with all other "single line things" in the WIT format.
lukewagner
pushed a commit
that referenced
this pull request
Sep 28, 2023
4 tasks
ydnar
added a commit
to bytecodealliance/go-modules
that referenced
this pull request
Oct 2, 2023
3 tasks
alexcrichton
added a commit
to alexcrichton/wasi-io
that referenced
this pull request
Oct 6, 2023
For more information see WebAssembly/component-model#249.
sunfishcode
pushed a commit
to WebAssembly/wasi-io
that referenced
this pull request
Oct 6, 2023
For more information see WebAssembly/component-model#249.
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
For more information see WebAssembly/component-model#249.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit commit is an implementation of #142 where semicolons are now required as delimiters between items in the WIT text format. All items in the WIT format are now delimited with either curly braces (
{}) or semicolons except for thepackagestatement where it subjectively felt a bit weird to require a semicolon. I've updated the various examples inWIT.mdas an example of the new syntax.My plan on implementing this would be along the lines of:
wit-parserwit-parsercrate can either or either not require semicolons.wasm-toolsrepository to require semicolons.wit-parserandwasm-tools, integrating the semicolon-supporting-mode into all existing tools.The hope is to create a period of time where both syntax forms are accepted. This provides a transitionary means from one syntax to the other while proposals are updated. This transitionary period is finite in length, however.
Closes #142