Replies: 4 comments 1 reply
-
One argument for option 1 came up when the documentation generation was discussed. With option 1 one doesn't need to build the repo and a C++ build toolchain in order to obtain the usage schema as it's the source, rather than the product. |
Beta Was this translation helpful? Give feedback.
-
One more argument for option 1 is that the codegen can be used for other languages. |
Beta Was this translation helpful? Give feedback.
-
And more on this: schemas are essentially not bound to plugins, but instead live their own lives. Multiple independent plugins should be able to support the same schema. For example a schema can be "LLM" with plugins And more on this. A plugin should be able support multiple schemas. |
Beta Was this translation helpful? Give feedback.
-
It's resolved. Schemas are to be much more complex and the only reasonable way to handle the complexity would be option 1. Schemas are independent of code and plugins |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Too much time has already been spent on this...
The current solution is unpleasant.
Object
instanceDict
get/setValue
Return
-snlohmann::json
whereas ourDict
will likely be modifiedThese all are fixable if we base the structure on something like https://github.com/alpaca-core/mini-reflect. Some problems will remain:
A redesign of
mini-reflect
is possible, where we separate the reflection info into instance-info and type-info. Then we wrap the fields in a template to properly instantiate (on-demand placement construct members would have to be implemented).Anyway... we can go very very deep in this rabbit hole and design a super cool runtime (auto-)reflection library. This will take multiple days or maybe a couple of weeks. There are many use cases and edge cases to consider.
While the task is pretty cool, I think it's time to draw the line and just use something simpler.
I've considered three alternative approaches:
visitFields
methods for wrapped structs.Dict
and vice versa.Blob
-s, andBlob
-s won't suffer from the above problem.Dict
-based fieldsDict
and generating schemaSo far I'm leaning heavily towards 2, despite the copy implications.
Beta Was this translation helpful? Give feedback.
All reactions