-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Bindgen! gives weird name to an interface well-named in WIT file #9774
Comments
I believe In this example it would be this method |
That works. Thanks! But I still think we should give a better name to this field, even if it's internal. Besides, the name scheme Also, this method |
Auto-docs sounds great yeah, but we can't easily change it to just world some-world {
export foo;
export foo: interface { ... }
}
interface foo { ... } While I agree it's wordy, it's needed to disambiguate. |
What!? I don't know that. So WIT specs allow exporting two interfaces that have the same name in the same world? This seems crazy to me. I guess in this case, we would just use |
Well, to clarify, these are two different syntactic forms of exports. One is a "full interface" which is technically named |
OK, seems I just need to dig into WIT specs........ but first let's get auto-docs working |
I don't know whether this is a bug or expected. I personally would consider it as a minor bug, but I leave it as a feature request.
Feature
I'd like
bindgen!
generates a sensible name for the bindings of interfaces in a WIT file.I have this WIT file. It exports an interface called
add
that contains only one functionadd
.In my Rust host, I need to run an
adder
component, so I write the host code likeInstead of a meaningful name like
"add"
,bindgen!
somehow generate the binding for interfaceadd
with the name"interface0"
. This seems weird to me. And I don't see why it can't be named as the same as the interface name.bindings.add.call_add
seems more natural to me.Benefit
The current naming is bad for readability and understanding, as no one can see from
interface0
that it has any relation to the interfaceadd
.interface0
means just the first interface.Changing the naming can improve readability, understanding and code writing.
Implementation
No, I am not very familiar with bindgen internals.
The text was updated successfully, but these errors were encountered: