Skip to content
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

Can this be the basis for a serialization library? #10

Open
jberryman opened this issue Nov 4, 2016 · 0 comments
Open

Can this be the basis for a serialization library? #10

jberryman opened this issue Nov 4, 2016 · 0 comments

Comments

@jberryman
Copy link
Owner

jberryman commented Nov 4, 2016

It's obvious that the Hashable class is about serialization, or feeding bytes to a consumer in a consistent way. We've found we already have to do mixConstructor, so already have something that looks close to a serialization/deserialization library. Note Hashable allows us to hash without allocating and actually writing to memory, so it is more appropriate to implement a serialization library in terms of (what we now call) Hashable rather than the other way around.

If we try this we'd also want a class for Hashable (Serializable) types of statically-known size (or even a statically-known maximum size for e.g. non-recursive sum types), so that the bytearray for a structure can be allocated all at once, when possible.

I don't have much motivation at the moment to build this or try to build consensus around using this as a core for hashing and serialization libraries, but just putting the idea in writing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant