-
Notifications
You must be signed in to change notification settings - Fork 64
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
The Sample
and Frame
traits would greatly benefit from the "associated consts" and "integer generics" features
#55
Comments
Agreed. One possibility though would be to keep the API the same through 1.0 and then add the associated consts as soon as that feature lands, deprecating the |
I just stumbled upon this library and saw this line in the docs, specifically for the
I'm not sure if this is still applicable, but associated constants are stable now. Maybe it's just me (not an expert Rust programmer), but I don't see how 23b7c6a has anything to do with, let alone closes, this issue... |
Thanks for the heads up! I must have accidentally referenced this pr number instead of another in that commit. I'll re-open this. I have had some other thoughts regarding this issue lately - I think it would be useful to be able to distinguish between fixed size frame lengths and dynamically sized frame lengths (e.g. |
According to rust-lang/rust#79135, it looks like a minimum subset of const generics will land in Rust 1.51, which should be releasing towards the end of March! If that's the case, I'd love to help out and "const generic"-ify the internals of |
@linclelinkpart5 please feel free! Exciting times in Rust land to have const generics nearing stabilisation :) I look forward to seeing how much we can improve upon |
Sample
could benefit fromEQUILIBRIUM
andIDENTITY
associated constants, allowing us to remove the methods that currently fill this role.Frame
could benefit from,NUM_CHANNELS
,EQUILIBRIUM
andIDENTITY
associated constants, allowing us to remove then_channels
andequilibrium
methods.Frame
would also massively benefit from integer generics of some sort in order to get rid of theNumChannels
associated type, the related trait and the macro-generated implementations for every frame size up to 32 (an arbitrary, unnecessary limit).It looks like associated consts at least will land soonish as the feature gate was recently removed. I'm not sure what the current state of integer generics is.
cc @andrewcsmith I'm leaning towards making this a 1.0 blocker as it will cause quite a significant impact on the API. Otherwise I guess we could aim to stabilise earlier and then release a
2.0
in the future when these features arrive. Looking into the progress on integer generics will probably help us to make a decision!The text was updated successfully, but these errors were encountered: