Skip to content
This repository has been archived by the owner on Nov 28, 2024. It is now read-only.

Showcase Generic Actions via Demo #11

Closed
wants to merge 1 commit into from

Conversation

GabrielSimonetto
Copy link
Contributor

Inspired by serde_way branch.
Part of the #8 discussion.

Showcases the need for some generic implementation of how to deal with particular records.

I make a particular proposal to use a trait that will be needed to run in the generic pipelines, which is not the full point of this draft, but it is a suggestion:

// // This is what it seems like we should do
// struct ModernBioFormat<F1: BioSerdeRead, F2: BioSerdeWrite> {
//     reader: F1,
//     writer: F2,
//     origin: String,
//     destination: String,
// }

Also it raises a problem with the current plan of how to write the many different formats: noodles will be prepared to use it's own struct definitions, which will be very costly in our conversion pipelines (but that may be just something that we will need to accept)

// This points out a problem:
//      even if we solve generic writers and readers
//      the bulk of our work will be to make the <write_record> itself
//
// In the specific case of Bed, it asks for specifically a bed::Record type.
//      which is a problem, because it forces our hand to conform
//      to a specific implementation
//      whereas being able to receive a generic trait of some sorts
//      would enable us to pass the IR main struct directly
//      (maybe we can already rehearse making a noodles PR in that sense
//          but that would require us to already have the IR definition)
mbf.writer.write_record::<3>(&record)?; 

@brainstorm
Copy link
Member

We are exploring serde now, this was good exploration anyway, thanks Gabriel!

@brainstorm brainstorm closed this Jun 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants