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

Breaking change wish list #72

Open
ia0 opened this issue Jul 4, 2023 · 0 comments
Open

Breaking change wish list #72

ia0 opened this issue Jul 4, 2023 · 0 comments
Labels

Comments

@ia0
Copy link
Owner

ia0 commented Jul 4, 2023

This issue lists breaking changes that could be worth doing. Since they would bump the major version, doing as much of them simultaneously would be best.

static instead of const

Using const prevents users to take long-term references, which is needed for Encoder. The constants should instead be statics.

const fn

This crate is mostly made of pure terminating functions (e.g. encode_len(), encode_mut(), decode_len(), and decode_mut()). Those functions should be const fn. This would replace the data-encoding-macro library which is currently working around the const fn limitations of Rust.

This is blocked by const fn support in Rust: meta tracking issue.

Private Encoding implementation

It should now be possible to make the Encoding implementation private and provide an unsafe const fn for data-encoding-macro to use.

MaybeUninit

Most output parameters are not read from but currently use &mut [u8] which requires them to be initialized. Those functions could instead take &mut [MaybeUninit<u8>].

This is mostly blocked by maybe_uninit_slice.

MSRV

Even if not necessary, bumping to the latest stable might give access to features that may be useful for future minor or patch versions. This is strictly speaking not a breaking change to bump MSRV (discussion), but it's nice to do it during a major bump. By discussion in #77 it would be nice to have the MSRV at rustc in Debian oldstable. This should cover most common distributions. Note also the trick to use syn = ">= 2, < 4" when multiple major versions are supported for a dependency.

Expose the polymorphic implementation

Currently only the type-erased API with internal dispatch is exposed. This may prevent dead-code elimination to trigger if encodings are not statically known, resulting in bigger binary size. As an alternative, the internal polymorphic API could be exposed.

This might be blocked by good const generics support in Rust.

@ia0 ia0 added the blocked label Jul 4, 2023
ia0 added a commit that referenced this issue Apr 28, 2024
This new module addresses the following breaking changes of #72:
- `static` instead of `const` for pre-defined encodings
- Private `Encoding` implementation with `unsafe` constructor
- Use `MaybeUninit` internally and expose `_uninit` functions
- Use static dispatch instead of dynamic dispatch (fixing #97)
ia0 added a commit that referenced this issue Apr 29, 2024
This new module addresses the following breaking changes of #72:
- `static` instead of `const` for pre-defined encodings
- Private `Encoding` implementation with `unsafe` constructor
- Use `MaybeUninit` internally and expose `_uninit` functions
- Use static dispatch instead of dynamic dispatch (fixing #97)
ia0 added a commit that referenced this issue May 1, 2024
This new module addresses the following breaking changes of #72:
- `static` instead of `const` for pre-defined encodings
- Private `Encoding` implementation with `unsafe` constructor
- Use `MaybeUninit` internally and expose `_uninit` functions
- Use static dispatch instead of dynamic dispatch (fixing #97)
ia0 added a commit that referenced this issue May 5, 2024
This new module addresses the following breaking changes of #72:
- `static` instead of `const` for pre-defined encodings
- Private `Encoding` implementation with `unsafe` constructor
- Use `MaybeUninit` internally and expose `_uninit` functions
- Use static dispatch instead of dynamic dispatch (fixing #97)
ia0 added a commit that referenced this issue May 5, 2024
This new module addresses the following breaking changes of #72:
- `static` instead of `const` for pre-defined encodings
- Private `Encoding` implementation with `unsafe` constructor
- Use `MaybeUninit` internally and expose `_uninit` functions
- Use static dispatch instead of dynamic dispatch (fixing #97)
ia0 added a commit that referenced this issue May 5, 2024
This new module addresses the following breaking changes of #72:
- `static` instead of `const` for pre-defined encodings
- Private `Encoding` implementation with `unsafe` constructor
- Use `MaybeUninit` internally and expose `_uninit` functions
- Use static dispatch instead of dynamic dispatch (fixing #97)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant