Skip to content
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

chore(examples): remove redundant world spec #1930

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

rvolosatovs
Copy link
Member

Feature or Problem

Remove the redundant world specification for wit-bindgen invocations. It's not necessary when there's only one world in the package

Related Issues

Release Information

Consumer Impact

Testing

Unit Test(s)

Acceptance or Integration

Manual Verification

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
@rvolosatovs rvolosatovs requested a review from a team as a code owner April 17, 2024 17:32
Copy link
Member

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍🏻

@rvolosatovs rvolosatovs enabled auto-merge (rebase) April 17, 2024 17:38
Copy link
Contributor

@vados-cosmonic vados-cosmonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we sure we want to do this? This is going to be worse for anyone looking at these to learn.

The fact that the world is auto-selected is not immediately obvious, but world: "..." makes it more explicit. We shouldn't depend on implicit functionality when someone completely new to the ecosystem might be showing up.

Maybe adding a comment to explain the mechanism would make sense -- wit_bindgen options and functionality are not very well documented at all, upstream.

@rvolosatovs
Copy link
Member Author

rvolosatovs commented Apr 17, 2024

Are we sure we want to do this? This is going to be worse for anyone looking at these to learn.

The fact that the world is auto-selected is not immediately obvious, but world: "..." makes it more explicit. We shouldn't depend on implicit functionality when someone completely new to the ecosystem might be showing up.

People completely new to the ecosystem are very unlikely to have more than one world defined in their WIT packages - it's an advanced feature and if anything, we should be steering developers away from it to avoid confusion.

In any case, these examples should not be using wit-bindgen at all - https://github.com/bytecodealliance/cargo-component is the standard tool to build Rust components, especially for newcomers

@vados-cosmonic
Copy link
Contributor

People completely new to the ecosystem are very unlikely to have more than one world defined in their WIT packages - it's an advanced feature and if anything, we should be steering developers away from it to avoid confusion.

The point wasn't that they're going to use the world option correctly -- it's that the term "world" connects the contents of the wit which they're likely to have seen before with the rust code they're writing, and the operation of bindgen.

To illustrate, the term in there would be grep-able at the very least -- if you named your world my-new-world, then a grep for that term would produce at least two results -- one in the lib.rs and one in the wit package. This makes it easy to correlate them/know the linkage.

In any case, these examples should not be using wit-bindgen at all - https://github.com/bytecodealliance/cargo-component is the standard tool to build Rust components, especially for newcomers

That's a reasonable point! We build with wit-bindgen because we use wash build to build the components, but wash could be modified to work well with cargo-component as well! That I think is somewhat outside the scope of this PR though.

@vados-cosmonic
Copy link
Contributor

In the interest of not holding up 1.0, we'll get this in and hopefully no one is confused by it

@vados-cosmonic vados-cosmonic dismissed their stale review April 17, 2024 17:52

prioritizing chages making it in before 1.0

@rvolosatovs rvolosatovs merged commit 173ffbc into wasmCloud:main Apr 17, 2024
58 checks passed
@rvolosatovs rvolosatovs deleted the chore/example-world-spec branch April 17, 2024 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants