-
Notifications
You must be signed in to change notification settings - Fork 12
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
Idea: what about proto de/ser? #247
Comments
Hi there! This is an interesting use case. I could see a WIT → Protobuf generator that helps ease this process. The underlying structures in target language would be different. That said, serializing WIT records into a confirming protobuf schema seems quite reasonable. How would this look, ideally, to you? |
I'd like it to be a tool, where you'd write something like: wit-bindgen-proto --out-dir 'some-folder' --package 'some-package' --wit(wit-recursive, wit-file) 'wit-folder' || 'wit-file' --records-only The reasoning for it, is because then I could pipe it into buf and generate go|rust|python|whatever files from the proto definitions. And the reason why I'd like wit-bindgen-proto not to also generate go files, is because I don't want to put everything in one folder, but have the choice to what I want to do with it further, e.g., centralized proto|wit definitions for a whole team. Specifically refered to by repositories / projects. This would also make it such that you guys wouldn't have to do a lot of work to support this, and the guys at f.ex buf.build could take it further to support wit->proto or proto->wit. |
How do you imagine the generated Go types from WIT would interact with the generated proto types? |
I dont see them interacting. Just that theyre versioned as datamodels from same definition. Proto for wireformat and contracts between apps external. Wit for internal communication. |
Do you plan to manually copy the data from the WIT types to the Proto types? To be honest, if that's your plan, I'd recommend just writing a protoc plugin that emits WIT for a given proto file. Protos have more information than WIT, e.g. field numbers, extensions, etc. |
Disclaimer: Sorry if this is not how you want ideas/challenges to be communicated, if this is wrong then how would I propose an idea? I couldn't find anything about this in your contributing guidelines.
Hey, I love your contributions to the open-source world. We're adopting wasmcloud in our organization but we have a problem.
We have to model for both external users and internal users, i.e., internal = WIT, external = proto. And modelling two places doesn't scale well, version-wise.
My wish would be:
Do you guys see any solutions you know, or is this thought of and avoided? If so, why?
The text was updated successfully, but these errors were encountered: