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

Implement BSON serialisation #19

Open
6 tasks
dmitrii-doronin opened this issue Mar 11, 2024 · 3 comments
Open
6 tasks

Implement BSON serialisation #19

dmitrii-doronin opened this issue Mar 11, 2024 · 3 comments

Comments

@dmitrii-doronin
Copy link
Contributor

dmitrii-doronin commented Mar 11, 2024

Implement BSON serialisation

Description

BSON serialisation is currently marked as 'planned' in our project. This feature is crucial for users who work with YAML data formats and expect our tool to support serialisation to BSON

Tasks

  • Select BSON parsing libraries that fit our codebase and evaluate their styles and compatibility
  • Test library performance, focusing on speed, memory, error handling, and scalability
  • Craft an BSON serialisation interface that matches our system's design and code standards
  • Build the BSON serialisation logic with an emphasis on maintainability and efficiency
  • Develop a suite of tests for BSON serialisation to ensure robustness
  • Update our docs to detail the BSON serialisation process, use cases, and API changes
@NeroBlackstone
Copy link
Contributor

NeroBlackstone commented May 4, 2024

One annoying thing is that BSON.jl doesn't actually support bson(io::IO; kws...), and outputs to a file by default, otherwise this feature would be very easy to implement.

help?> bson
search: bson BSON SubstitutionString AbstractIrrational AbstractFloat BoundsError

  No documentation found.

  BSON.bson is a Function.

  # 3 methods for generic function "bson" from BSON:
   [1] bson(path::String; kws...)
       @ ~/.julia/packages/BSON/mzJoC/src/write.jl:89
   [2] bson(path::String, doc::AbstractDict)
       @ ~/.julia/packages/BSON/mzJoC/src/write.jl:87
   [3] bson(io::IO, doc::AbstractDict)
       @ ~/.julia/packages/BSON/mzJoC/src/write.jl:85

A easy workaround is convert kws... to Dict{Symbol, Any} by Dict(kws) and invoke bson(io::IO, doc::AbstractDict).

I also want to ask, currently we have no implementation of outputting binary format. Should we just output Vector{UInt8} like other existing implementations, or provide an option to output to a file?

@NeroBlackstone
Copy link
Contributor

It would be nice if you could provide some use cases for serialization and deserialization, sounds like converting yaml to bson? I'm a little confused.

@dmitrii-doronin
Copy link
Contributor Author

Hi, again! That's what I had in mind. Just have some sort of a workaround to work with BSON.jl package for now. As for use cases, the most common is web development, where you want to send data more efficiently or work with binary data formats, so streaming is to a file is not really needed at the current stage so working with Vector{UInt8} and a print function should suffice.

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

3 participants