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

Refactor arithmetic with macros + generics #10

Open
4 tasks
jdwhite48 opened this issue Jan 31, 2022 · 0 comments
Open
4 tasks

Refactor arithmetic with macros + generics #10

jdwhite48 opened this issue Jan 31, 2022 · 0 comments
Assignees
Labels
restructure The API could be organized better

Comments

@jdwhite48
Copy link
Owner

jdwhite48 commented Jan 31, 2022

There is a significant amount of code re-use in data_structures.rs, which makes maintaining the code unreasonably difficult to work with; in particular, Com1 and Com2 are implemented incredibly similarly.

  • Figure out if it's possible for a macro to include a "match" statement on the identifier passed as input such that, if it equals a certain value (e.g. Com1), one can define a new identifier macro variable based on it (e.g. G1Affine)
  • Coalesce Com1 / Com2 implementations to a greater extent (and also ComT, if it shares any similarities that can be macro'ed out)
  • Similarly, coalesce Mat implementations for Com1, Com2, and/or field matrices, if possible (may require implementing Com1 and Com2 as a Field, or specifying the current Field generics at a finer-grained level)
  • Optionally, consider defining a mat![ a, b, c; ... ; ...] macro (or similar) which expands out to vec![vec![a, b, c], vec![...]. vec![...]

This should be transparent to the API and test cases.

@jdwhite48 jdwhite48 added the restructure The API could be organized better label Jan 31, 2022
@jdwhite48 jdwhite48 self-assigned this Jan 31, 2022
@jdwhite48 jdwhite48 added good first issue Good for newcomers and removed good first issue Good for newcomers labels Jan 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
restructure The API could be organized better
Projects
None yet
Development

No branches or pull requests

1 participant