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

feat(serde): borsh #110

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

dzmitry-lahoda
Copy link

PRed here because serde feature is here.

Copy link
Collaborator

@jswrenn jswrenn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my first time hearing of borsh, but since it has decently widespread optional support in other crates, I'm not totally opposed to including it as an optional feature.

Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@dzmitry-lahoda
Copy link
Author

dzmitry-lahoda commented Jan 22, 2025

This is my first time hearing of borsh, but since it has decently widespread optional support in other crates, I'm not totally opposed to including it as an optional feature.

borsh does:

  1. no schema in encoded data
  2. deterministic encdec
  3. no waste of data on tags (important if storage of very high price, like in persistent provable systems; and if CPU is high cost too)
  4. performance of code generated by macro is not limited by reusing serde crate attributes (high cost of CPU)
  5. small enum discriminates and sequence prefixes encoding
  6. rust first with best rust support without need of external tooling, and yet with C++/TS/python impls

These requirements eliminate protobuf, cbor, bson, bincode, etc.

Cargo.toml Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
Co-authored-by: Jack Wrenn <me@jswrenn.com>
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

Successfully merging this pull request may close these issues.

3 participants