-
Notifications
You must be signed in to change notification settings - Fork 642
update: first update for serialization documentation restructuring #2978
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want to be accurate in how serialization works. The "intermediate data" representation is misleading, an intermediate format is fundamentally impossible (even without supporting format specific escape hatches such as JsonPolymorphicSerializer
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Calling the middle step Primitives is misleading (as this is not Kotlin/Java primitive types). Instead the middle steps are actually serialization library calls (with a given set, including primitive types, but also supporting structures and "special" types).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @pdvrieze - thank you for your comments 💯 - we are still in the review process for these updates (just a draft PR at this point), but we will take a look at your feedback during the review
1. Serialization: Objects are transformed into a sequence of their primitive values. | ||
This universal process varies depending on the object and is managed by a serializer. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is misleading. Serialization translates objects to a sequence of encoder calls. There is no intermediate format, and such a format would not actually work (many formats allow for "special casing").
The reverse process involves parsing the input format, decoding the primitive values, and then deserializing the resulting | ||
stream into objects. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reverse process involves the decoder invoking the input format to guide it in parsing the input (there is no intermediate format and that cannot exist - note that formats may not allow parsing without the knowledge of specific data structures (generally non-self-describing binary formats)).
|
||
## Kotlin serialization libraries | ||
|
||
The `kotlinx.serialization` library offers support for all platforms, including JVM, JavaScript, Native. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be worthwhile to clarify more that the serialization library provides the format agnostic infrastructure. Then the -json
and -cbor
libraries are format implementations (they are fundamentally different and are independent even though first-party).
This PR is for the first batch of documentation updates for KT-66330
Additional PRs will be opened on this one.