-
Notifications
You must be signed in to change notification settings - Fork 4
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
Write support? #37
Comments
Makes sense, I experimented with the writer API a few years ago. Does this API look desirable? If so, I can look to resurrect it. master...io#diff-3e344dc31cd763c82ee7b32eb4d1423b17150a15ade513ff4ab002bdad81ff47 |
Looks ok mostly. These two look a bit weird:
why is |
Thanks for looking it over.
Yeah that's a holdover from something else, and wouldn't be signed if writer support is made live
I believe I intended a similar behavior to bitstream's implementation, however it's been a few years and I'm open to suggestions. |
Ok make sense. the bistream implementation also has this |
Yeah that's a good idea. |
FWIW, I'm looking to implement some compression codes such as would you be interested to have these as contributions? e.g. |
Sure, though if these functions don't introduce anything new in the way of primitives, I'd recommend defining an extension trait in downstream crates where this functionality can be ergonomically exposed. An earlier version of this crate contained a lot of specific APIs that were only relevant to my domain. So, I removed them to better focus on making sure that the right primitives are exposed so others (including myself) can build the right abstractions. |
I would argue if you are writing/reading integers with different bit widths, writing them using codes like elias_gamma delta etc. is something I would expect in a bit-I/O crate. Instead of writing a u32 with 32 bits I would want to encode it using elias_gamma for example and there exist many compression techniques where different numbers in the stream are encoded/decoded that way. |
But if you don't want these here I'll create a separate crate but I would still be interested in write support |
I agree, universal codes are useful. Questions arise, like which codes to support? What would the API look like? Should there be separate APIs to handle non-positive numbers? Are there codes that can't be generalized and input has to be positive only? Very exciting questions. That's why it might be better to iterate outside the main bitter api so that these changes can be incorporated when there's confidence in the design and implementation. |
Interested in using this crate but it is a bit unergonomic to having to resort to a different crate to write the bit patterns and then switch to this to read them
The text was updated successfully, but these errors were encountered: