Skip to content

feat!: implementing BignumTrait for each type using metaprogramming#151

Merged
TomAFrench merged 31 commits intomainfrom
kb/trait_impls
Apr 14, 2025
Merged

feat!: implementing BignumTrait for each type using metaprogramming#151
TomAFrench merged 31 commits intomainfrom
kb/trait_impls

Conversation

@kashbrti
Copy link
Copy Markdown
Contributor

@kashbrti kashbrti commented Mar 20, 2025

Description

We move the BigNumTrait impls into a compttime macro.
For each BigNum type that we construct, we call this macro to implement all the functions in the trait
with the correct generics.

Problem*

Resolves
#142

Summary*

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

Comment thread src/bignum.nr Outdated
Comment thread src/bignum.nr Outdated
Comment thread src/bignum.nr Outdated
@kashbrti kashbrti marked this pull request as ready for review April 8, 2025 11:20
@kashbrti kashbrti changed the title feat!: getting rid of BigNum struct (WIP) feat!: implementing BignumTrait for each type using metaprogramming Apr 8, 2025
@kashbrti
Copy link
Copy Markdown
Contributor Author

kashbrti commented Apr 8, 2025

@TomAFrench, this PR will have significant changes to the interface. Should I update the ReadMe accordingly?

@TomAFrench
Copy link
Copy Markdown
Member

Yeah, we'll need to update the readme to account for these changes. Please do.

@TomAFrench
Copy link
Copy Markdown
Member

I've made a few cleanup changes in the last few commits:

  • BigNum struct is removed and BigNumTrait is renamed to BigNum to be less tautological.
  • The BigNumParamsGetter trait is removed along with all of the unit structs which implement it.
  • I've shifted some of the implementations of bignum trait methods into the definition so we can just have a default implementation rather than relying on metaprogramming for everything.

@kashbrti
Copy link
Copy Markdown
Contributor Author

kashbrti commented Apr 8, 2025

@TomAFrench I'm updating the paramgen as well to work with this version of the lib

@TomAFrench TomAFrench enabled auto-merge (squash) April 14, 2025 22:45
@TomAFrench TomAFrench merged commit 6a7cf5f into main Apr 14, 2025
14 checks passed
@github-project-automation github-project-automation Bot moved this from 👀 To Triage to ✅ Done in Noir Libraries Apr 14, 2025
@github-actions github-actions Bot mentioned this pull request Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants