GithubHelp home page GithubHelp logo

Comments (4)

matklad avatar matklad commented on May 23, 2024 3

Hm, I think this is not the right thing to do. My understanding is that one (primary) design goal of borsh is canonicity/consistency:

Consistency means there is a bijective mapping between objects and their binary representations. There is no two binary representations that deserialize into the same object. This is extremely useful for applications that use binary representation to compute hash;

https://borsh.io

Serde is not canonical -- it can deserialize the same object from different representations (eg, order of key/values in a hashmap). We can't layer a canonical repr on top of a non-canonical one.

If the particular use-case does not require canonicity, then bincode should be used instead of borsh.

from borsh-rs.

frol avatar frol commented on May 23, 2024 1

I did not know that feature of serde. I am closing this issue since there are not action items

from borsh-rs.

frol avatar frol commented on May 23, 2024

Great proposal! I think it should be possible to implement it under a feature-flag, and also prefer native Borsh implementations before falling back to serde serializations.

from borsh-rs.

praveenperera avatar praveenperera commented on May 23, 2024

This would be a great feature.

I was looking to replace Bincode with Borsh, but without being able to use serde_rename and having derives for UUID and other third party structs the friction is too high.

from borsh-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.