-
Notifications
You must be signed in to change notification settings - Fork 129
Add getters and setters (#235) #701
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
Open
bvisness
wants to merge
10
commits into
WebAssembly:main
Choose a base branch
from
bvisness:get-set
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e6ab489
Add getters and setters to WIT and AST
bvisness 9639973
Make [*]l.l more general again; improve examples
bvisness f2aa864
Emoji-gate getters and setters
bvisness cb43e7e
Tweaks
bvisness f230fc0
Add static and interface getters and setters
bvisness b08dd0b
Fixes from review
bvisness 56a2d23
Remove get-before-set rule from WIT only
bvisness 417e0ea
Rogue comma
bvisness bbcfc9f
Remove reserved keywords, add clarifying [method] note
bvisness 3572b56
Remove rogue order requirement
bvisness File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
Thinking about this some more:
The rule on its own makes sense, though the tooling side of things prbably makes it impractical:
This makes me lean towards:
class, etc. There have been ideas about such a linter tool before, but as of yet no such thing exists.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.
I have no idea why you think toolchains have no control over the order in which symbols are emitted; Luke already pointed out in this comment that we already have a rule today saying that
rmust precede[method]r.foo. What makes this any different?As for dead code elimination, surely component tooling is generally not quick to delete "unused" functions, because the functions (used or unused) define the component / instance's type. And besides, if some component tooling is indeed performing some kind of whole-component optimization pass, it seems reasonable for it to be aware of constraints on getters and setters.
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.
While at the core wasm level, I think @badeend is right that core symbols are emitted object-file-by-object-file in arbitrary order with no well-defined global order, what we're talking about here is component-level imports and exports that are emitted by
wasm-tools component newwhich sees the target world and knows the validation rules and order things before generating the final component output.