You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose of a common set of operations that should be implemented by all borsh implementations in different programming languages. Some implementation, like rust has macros, can have additional features such as derive[BorshSerialize]
From borsh user, they're going to use borsh in this way.
write a borsh schema definition that would be common in any language, currently it's in json, but json isn't very friendly human writable, so we may consider yaml, toml, or a rust type definition like DSL. They're all equivalent and can trivially convert to each other. This defines type they want to serialize/deserialize.
borsh should be able to generate these from schema:
language native type definitions (class for python/js, struct for c, golang, rust, solidity)
function/methods to serialize and deserialize these types
People then use the generated source code.
With this schema based approach, each language's borsh implementation is:
(optional) convert between json schema to other format of borsh definition
cli to generate source code from schema definition
small util functions to deser/ser certain primitive types, strings, vecs, unsigned integers, etc.
(for dynamic typed languages) a dynamic version of deser/ser function that takes a schema and a bytes/object, return deserialized object/serialized bytes
@nearmax WDYT? is this how borsh schema suppose to work?
The text was updated successfully, but these errors were encountered:
I propose of a common set of operations that should be implemented by all borsh implementations in different programming languages. Some implementation, like rust has macros, can have additional features such as
derive[BorshSerialize]
From borsh user, they're going to use borsh in this way.
write a borsh schema definition that would be common in any language, currently it's in json, but json isn't very friendly human writable, so we may consider yaml, toml, or a rust type definition like DSL. They're all equivalent and can trivially convert to each other. This defines type they want to serialize/deserialize.
borsh should be able to generate these from schema:
People then use the generated source code.
With this schema based approach, each language's borsh implementation is:
@nearmax WDYT? is this how borsh schema suppose to work?
The text was updated successfully, but these errors were encountered: