-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add support for standard library types #120
Comments
How should a data structure with multiple possible ways of serialization be serialized? The motivating example is |
I usually try to follow these rules:
So for As for |
@polykernel, after thinking for a bit, I feel like serializing Thoughts on representing |
I think it is sensible to represent |
Ahh okay, I haven't worked with multisets often so I wasn't aware that they're usually maps. I'll note that down in the original post. |
@ibokuri Sorry, I worded this terribly. By represented as maps, I actually mean implemented as/similarly to maps rather than represented as maps in serialized form. On second thought, I realized I overgeneralized the statement, I know in C++ (at least in libstdc++ and libc++), multiset is implemented like map except the value being stored is the same as the key, but I am definitely not qualified to assess what is usual implementation strategy of multiset is in general. After some more pondering, I came up with a list comparing the advantages/disadvantages for both seq and map serialization, please let met know if there are points I missed. # Seq
+ Preserves semantics: a multiset is semantically a type of unordered collection
- Redundant processing: multiplicity information is lost in the process of serialization
which requires unnecessary processing by the receiving end to recover
- Succinctness: the size of the encoding is proportional to the number of values in the multiset
# Map
+ Succinctness: the size of the encoding is proportional to the number of unique values in the multiset
+ Readability: a key-value mapping is more readable than a sequence with unspecified ordering
- Breaks semantics: a multiset is not semantically equivalent to a map, but rather an unordered
collection with additional information Base on the comparison, it seems serializing to maps is the better option. Furthermore, it may be worthwhile to support deserializing from maps as well. I will take a shot at implementing this when I have some time. |
General
If you'd like to see a certain
std
type gain support in Getty, please leave a comment and I'll add it to the hit list.Also, feel free to work on any of the types listed below. If you have any questions, you can ask them on our Discord or in this issue.
The Hit List
The text was updated successfully, but these errors were encountered: