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

Add codegen option instead of derive #90

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

amaloz
Copy link
Contributor

@amaloz amaloz commented Sep 21, 2022

This MR exposes the zero, one, and multiplicative_generator values as constants rather than functions. It might be preferred to only have the constants version---and I'm happy to make that change if so---but for now I've left the original function versions as well.

@tarcieri
Copy link
Contributor

Related: #87

doesn't cache the output of the proc macro, and using the derive form of
this code can cause slowdowns in `cargo check` and `rust-analyzer`.

As an alternative, this commit introduces an option to generate the
`PrimeField` implementation in a `build.rs` script, to avoid the
slowdown.
@str4d
Copy link
Member

str4d commented Oct 28, 2022

This PR is now almost entirely the codegen changes, which cannot be reviewed in the same PR as the trait changes. So I'm going to make my own PR on top of #93 that adds the associated constants, and we can use that to investigate the ecosystem and confirm whether it will cause any issues for downstream trait implementors (#87 (comment)).

@str4d
Copy link
Member

str4d commented Nov 2, 2022

#87 has now been closed by #94. This PR now needs rebasing, after which it will only contain the proposed codegen changes.

@str4d str4d changed the title Expose zero, one, and multiplicative_generator as constants Add codegen option instead of derive Nov 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants