-
Notifications
You must be signed in to change notification settings - Fork 18
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
Automation of proto R/W in hierarchies #61
Comments
This is extremely interesting, but kind of far fetched at the moment. The problem is that a proto is only as good as its submessages, one could have a general proto like
this is likely to fit all the possible states and hypers that we want to work with.
and here's where the fun begins: how do you do it? In Python, one can iterate through the elements of
where the last else should be able to handle nested objects There are some tools to add reflection (one that I know of is https://github.com/garbageslam/visit_struct) but before settling for one, I would see what is the ecosystem available. On the other hand, we could get rid of proto, and use some other C++ based serialization library only meant for C++. This would make life for pybmix a little harder, since then one needs to fine another workaround to pass the chains back and forth, but I'm open to discussion |
Yeah, I figured it all comes down to looping on a struct's fields. Python dictionaries really spoiled us huh. |
I'm not sure what you mean by "could we outsource the writing to another programming language?" What is it you have in mind? |
Like, embedding lines of another programming language (Python?) to perform that operation. I don't have anything particular in mind, I don't even know if it's possible or efficient. Just brainstorming. |
I don't see how this could work... An object is a sequence of bytes, the programming language knows how to interpret those bytes. |
Something that just crossed my mind. Do we have any way to automatize this process? maybe through a standardized interface for protos? The functions
read
/write_state_to_proto()
andwrite_hypers_to_proto()
are really the only low-level hierarchy operation left to the user's manual implementation. It would be amazing if they didn't have to do that.The text was updated successfully, but these errors were encountered: