Skip to content

Update Rust example with clear identifiers #207

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
jordithijsman opened this issue Mar 5, 2025 · 0 comments
Open

Update Rust example with clear identifiers #207

jordithijsman opened this issue Mar 5, 2025 · 0 comments

Comments

@jordithijsman
Copy link

Currently the Rust example often uses the same name for packages, functions, worlds, interfaces. (This might also be the case elsewhere in the book, not sure)

Example:

```wit
package docs:adder@0.1.0;
interface add {
add: func(a: u32, b: u32) -> u32;
}
world adder {
export add;
}
```

Here the package name is the same as the world name and the interface name is the same as the function name. Once you start using it elsewhere in the example it can be very unclear if you refer to the package, world, interface,... While this works fine for someone who is just copy pasting the example, true understanding requires one to know where to reference what exactly. This example is very hard to extrapolate to other components and projects.

I would propose that the examples clearly label everything e.g., adder-package, adder-world,...

If other people agree I could create a pull-request for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant