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

Generating schemas with language adapters (as optional add-ons)? #8237

Open
xparq opened this issue Feb 14, 2024 · 0 comments
Open

Generating schemas with language adapters (as optional add-ons)? #8237

xparq opened this issue Feb 14, 2024 · 0 comments

Comments

@xparq
Copy link

xparq commented Feb 14, 2024

(I'm new to FlatBuffers, just started familiarizing (evaluating it for a C++ serialization solution), sorry if I'm missing something that's obvious to others.)

As I understand, there's no way around writing schemas manually (apart from schema-less mode -- which I'd actually be fine with, as a fallback). IOW, no way to directly process the original sources for (e.g. marked-up) data declarations so the details of the (ever changing) real data won't need to be duplicated (with the inevitable risk of going out of sync over time).

Any ongoing efforts, plans, ideas etc. -- or prohibiting factors -- regarding this?

Schema generators would obviously not expected to be full-fledged parsers completely understanding the original language. They could do with a vastly simplified syntax, with restrictions on language features, additional markups in comments etc. etc. -- IOW they would define a common (sub)language both them and the original compiler -- and also the user -- can be happy with. (For one, I'd be 100% willing to sacrifice some coding convenience and maintain my data defs. in this restricted fashion, in exchange for eliminating the parallel maintenance effort.)

That's still a huge amount of work, but to me, after >20 years of forgetting to update ctors/dtors, assignment, compar. ops. etc. even right within the live code itself (to keep at least that consistent) the effort still seems worth it.

(Note: even if the generated schemas would be crude and need polishing, I guess those might still be lighter, somewhat more static "add-on" changes, or at least likely more stable in nature than the typical changes to the original data structures themselves, which means they could perhaps be auto-merged most of the time into the freshly regenerated raw schemas, so even this might still be a more robust process for overall consistency than manually updating the schemas every time the types change in the sources.)

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

No branches or pull requests

1 participant