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

Byte-ordering in serialization #2707

Open
harendra-kumar opened this issue Jan 29, 2024 · 0 comments
Open

Byte-ordering in serialization #2707

harendra-kumar opened this issue Jan 29, 2024 · 0 comments

Comments

@harendra-kumar
Copy link
Member

harendra-kumar commented Jan 29, 2024

The Unbox type class is meant to serialize the Haskell data structures in the host memory. There is absolutely no need to change the endianness in this case when copying structures to/from host memory.

When we designed the Serialize type class we modeled it on Unbox and kept is compatible with Unbox. Though there is no need to do that. The Serialize type class also uses the host byte order when serializing. But we can support portable byte-ordering as well if there is a need for that. One way is to fix the byte-ordering of the Serialize type class to LE or have SerializeLE or SerializeBE type classes for that purpose. Another way is to use BE/LE as an option in Serialize deriving.

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

No branches or pull requests

1 participant