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

Consider removing const generics #7

Closed
sragss opened this issue Jun 29, 2023 · 0 comments
Closed

Consider removing const generics #7

sragss opened this issue Jun 29, 2023 · 0 comments
Labels
refactor Cosmetic or organizational changes

Comments

@sragss
Copy link
Collaborator

sragss commented Jun 29, 2023

Surge makes extensive use of const generics to allow statically sized arrays throughout rather than Vectors or Slices.

In order to use this pattern through our generic SubtableStrategy traits we require the use of feature(generic_const_exprs) which is highly unstable. Beyond the instability, we have strange artifacts on many of our impls, such as [(); S::NUM_SUBTABLES]: Sized. These tell the compiler that the const generic expression is bounded.

It's likely that the overhead of using Slices and len asserts everywhere is minimal enough to be irrelevant. It's worth considering whether the benefit is worth the downside.

@moodlezoup moodlezoup added the refactor Cosmetic or organizational changes label Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Cosmetic or organizational changes
Projects
None yet
Development

No branches or pull requests

2 participants