You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Languages like Kotlin & DemoGen currently use conf.toml files for certain top-level configuration attributes during codegen.
Ideally, we'd be able to specify language-binding specific top-level attributes, like python module name or kotlin domain, in the actual source rather than relying on separate toml files.
Exact syntax TBD. This may be complicated since a crate will usually have multiple implementation files (as in the feature_tests example).
The ideal solution would be to allow specifying one and only one DiplomatConfig object per crate, then append multiple key/value pairs to it.
The way I see it is that it can work similarly to the attribute system, where there are some common config keys (e.g. lib_name) that are shared between backends that care, and there can be backend-specific stuff too if we ever want.
I'd want the config to be specifiable from multiple places
And of course we can have a programmatic API for this too.
In general I do not want Diplomat to ever have to parse Rust expressions, so having the config be specified in lib.rs as something other than attributes is not great.
Proposal for steps:
Design a shared Config type with the right entries and structure, so that it is easily extended. Probably something like struct Config { shared: SharedConfig, cpp: CppConfig, ...}.
Have it deserialize from toml to retain current functionality
Broken out from a discussion in #767
Languages like Kotlin & DemoGen currently use conf.toml files for certain top-level configuration attributes during codegen.
Ideally, we'd be able to specify language-binding specific top-level attributes, like python module name or kotlin domain, in the actual source rather than relying on separate toml files.
Exact syntax TBD. This may be complicated since a crate will usually have multiple implementation files (as in the feature_tests example).
The ideal solution would be to allow specifying one and only one DiplomatConfig object per crate, then append multiple key/value pairs to it.
rough sketch:
lib.rs
The text was updated successfully, but these errors were encountered: