-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use semicolons as delimiters in WIT text format #249
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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) |
Looks like no disagreement, so merging. |
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.
For more information see WebAssembly/component-model#249.
For more information see WebAssembly/component-model#249.
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 thepackage
statement where it subjectively felt a bit weird to require a semicolon. I've updated the various examples inWIT.md
as an example of the new syntax.My plan on implementing this would be along the lines of:
wit-parser
wit-parser
crate can either or either not require semicolons.wasm-tools
repository to require semicolons.wit-parser
andwasm-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