Mechanical witx naming convention changes#137
Merged
Conversation
sunfishcode
reviewed
Nov 4, 2019
07d88a8 to
371eec1
Compare
Contributor
Author
|
Review feedback and merge conflicts are fixed |
371eec1 to
0817768
Compare
ea38d22 to
b350928
Compare
Contributor
Author
|
Rebased on #140. There were more conflicts than were worth resolving by hand, so I re-ran the sed commands and then re-applied the fixups. |
added 9 commits
November 11, 2019 16:56
this suffix is not appropriate for all languages that may need to generate code from witx, so this change removes it from all witx files and leaves the code generator in charge of putting the appropriate suffix onto any type names it produces. sed -i -E 's/\$([a-z_]+)_t([)\n\r ])?/\$\1\2/g' **/*.witx
Change all $SHOUTY_SNAKE_CASE identifers to $snake_case. It is the responsibility of a code generator backend to select the right case and style of these identifiers for the target language. In witx, we should standardize on snake case (lowercase with a single underscore as a word separator) sed -i -E 's/\$([A-Z0-9_]+)([)\n\r ])?/\$\L\1\2/g' **/*.witx
once again, the code translation tool is responsible for putting the right prefix in the generated code. languages with proper namespacing facilities don't need the identifiers themselves to be namespaced. otherwise, you can derive the namespacing prefix from the type name. sed -i -E 's/\$(clock_|right_|whence_|filetype_|advice_|fdflag_|filestat_set_|lookup_|o_|st_|sock_|shut_|preopentype_)/\$/g' **/*.witx
doing so by regexp would delete various other valid event_ prefixes
this one could have been mechanical, but i left it out of the regexp
b350928 to
5479984
Compare
sunfishcode
approved these changes
Nov 12, 2019
Member
sunfishcode
left a comment
There was a problem hiding this comment.
Looks good! This will help reduce the C-specific feel of the overall API :-).
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
* witx: drop trailing `_t` from all typenames this suffix is not appropriate for all languages that may need to generate code from witx, so this change removes it from all witx files and leaves the code generator in charge of putting the appropriate suffix onto any type names it produces. sed -i -E 's/\$([a-z_]+)_t([)\n\r ])?/\$\1\2/g' **/*.witx * witx: change identifiers to snake case Change all $SHOUTY_SNAKE_CASE identifers to $snake_case. It is the responsibility of a code generator backend to select the right case and style of these identifiers for the target language. In witx, we should standardize on snake case (lowercase with a single underscore as a word separator) sed -i -E 's/\$([A-Z0-9_]+)([)\n\r ])?/\$\L\1\2/g' **/*.witx * witx: mechanically remove repeated prefixes from flags, enums once again, the code translation tool is responsible for putting the right prefix in the generated code. languages with proper namespacing facilities don't need the identifiers themselves to be namespaced. otherwise, you can derive the namespacing prefix from the type name. sed -i -E 's/\$(clock_|right_|whence_|filetype_|advice_|fdflag_|filestat_set_|lookup_|o_|st_|sock_|shut_|preopentype_)/\$/g' **/*.witx * restore fields named pr_type and d_type * remove $event_ prefix from eventrwflags member doing so by regexp would delete various other valid event_ prefixes * remove eventtype_ prefix from enum fields this one could have been mechanical, but i left it out of the regexp * restore oflags, fdflags argument names in path_open * witx: delete leading `sig` from each $signal enum variant * witx: delete leading `e` from each $errno enum variant * fixup test * witx: fix up old style names in comments
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
* witx: drop trailing `_t` from all typenames this suffix is not appropriate for all languages that may need to generate code from witx, so this change removes it from all witx files and leaves the code generator in charge of putting the appropriate suffix onto any type names it produces. sed -i -E 's/\$([a-z_]+)_t([)\n\r ])?/\$\1\2/g' **/*.witx * witx: change identifiers to snake case Change all $SHOUTY_SNAKE_CASE identifers to $snake_case. It is the responsibility of a code generator backend to select the right case and style of these identifiers for the target language. In witx, we should standardize on snake case (lowercase with a single underscore as a word separator) sed -i -E 's/\$([A-Z0-9_]+)([)\n\r ])?/\$\L\1\2/g' **/*.witx * witx: mechanically remove repeated prefixes from flags, enums once again, the code translation tool is responsible for putting the right prefix in the generated code. languages with proper namespacing facilities don't need the identifiers themselves to be namespaced. otherwise, you can derive the namespacing prefix from the type name. sed -i -E 's/\$(clock_|right_|whence_|filetype_|advice_|fdflag_|filestat_set_|lookup_|o_|st_|sock_|shut_|preopentype_)/\$/g' **/*.witx * restore fields named pr_type and d_type * remove $event_ prefix from eventrwflags member doing so by regexp would delete various other valid event_ prefixes * remove eventtype_ prefix from enum fields this one could have been mechanical, but i left it out of the regexp * restore oflags, fdflags argument names in path_open * witx: delete leading `sig` from each $signal enum variant * witx: delete leading `e` from each $errno enum variant * fixup test * witx: fix up old style names in comments
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
…ly#137) * wit-deps update to latest io streams.wit, which exposes `error` * add `filesystem-error-code`, for elaborating `stream.error` * generate markdown
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
…yntax Enclose URLs in documentation with angle brakcets.
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
* witx: drop trailing `_t` from all typenames this suffix is not appropriate for all languages that may need to generate code from witx, so this change removes it from all witx files and leaves the code generator in charge of putting the appropriate suffix onto any type names it produces. sed -i -E 's/\$([a-z_]+)_t([)\n\r ])?/\$\1\2/g' **/*.witx * witx: change identifiers to snake case Change all $SHOUTY_SNAKE_CASE identifers to $snake_case. It is the responsibility of a code generator backend to select the right case and style of these identifiers for the target language. In witx, we should standardize on snake case (lowercase with a single underscore as a word separator) sed -i -E 's/\$([A-Z0-9_]+)([)\n\r ])?/\$\L\1\2/g' **/*.witx * witx: mechanically remove repeated prefixes from flags, enums once again, the code translation tool is responsible for putting the right prefix in the generated code. languages with proper namespacing facilities don't need the identifiers themselves to be namespaced. otherwise, you can derive the namespacing prefix from the type name. sed -i -E 's/\$(clock_|right_|whence_|filetype_|advice_|fdflag_|filestat_set_|lookup_|o_|st_|sock_|shut_|preopentype_)/\$/g' **/*.witx * restore fields named pr_type and d_type * remove $event_ prefix from eventrwflags member doing so by regexp would delete various other valid event_ prefixes * remove eventtype_ prefix from enum fields this one could have been mechanical, but i left it out of the regexp * restore oflags, fdflags argument names in path_open * witx: delete leading `sig` from each $signal enum variant * witx: delete leading `e` from each $errno enum variant * fixup test * witx: fix up old style names in comments
yoshuawuyts
pushed a commit
to yoshuawuyts/WASI
that referenced
this pull request
Nov 25, 2025
…rc-2025-09-16 Update 0.3.0 WIT definitions to 0.3.0-rc-2025-09-16
alexcrichton
added a commit
to alexcrichton/WASI
that referenced
this pull request
Jan 29, 2026
* Update WIT vendoring source and wit-bindgen This commit updates how WITs are vendored here to use `wkg` the same way that bytecodealliance/wasmtime#12327 does. This then updated to use the latest `wit-bindgen` to be able to process the WITs which had a few extra artifacts in them that made it necessary. Generated bindings are changing here, but it's just things moving around. * Update wit-bindgen * Update other CI tools * Update MSRV to 1.87.0 * Update/pin more tools
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.
Witx files started out encoding the types directly from the wasi/core.h header, including the C rules around identifier capitalization and namespacing.
This PR drops those conventions that are specific to the C language. We do so uniformly in each witx file, meaning we change both the current unstable and the contents of
phases/old, so that code generators that know about these new conventions can still support all witx files in this repo.I performed the following changes, mechanically when possible (leaving the sed script in the commit message):
_tfrom all typenames.thistypename_prefix, with underscore to make it obvious. These were done by sed where possible.$errnoenum cases had the leadingedropped, all$signalenum cases had the leadingsigdropped.