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

Use procedural macro for g! and s! macros #170

Merged
merged 3 commits into from
Jan 3, 2024
Merged

Conversation

LLFourn
Copy link
Owner

@LLFourn LLFourn commented Sep 19, 2023

This gives us much more expressivity in the macros:

  1. No more {..} when you need to call methods or access tuple or array elements.
  2. New .* dot product operator which replaces manually called op::lincomb.
  3. New scalar division operator / (mostly for fun -- it's used in one place in ecdsa_fun).

RIP macro_rules stack machine.

In order to design the thing correctly I also tried to make everything copy (#146) to maintain backwards compat with omitting &.
In the end I didn't really use that but instead just allowed you to pass a reference to most of the functions in op which also fixes #125.

This is probably a breaking change due to some slight changes in the way some parts of the expressions are interpreted.

I've done benchmarks to confirm that there's no performance regression in terms of what is produced.

Fixes #146 #125 #6

@LLFourn LLFourn force-pushed the proc_macro_arithmetic branch 3 times, most recently from 35ffa28 to 2288686 Compare September 19, 2023 05:05
To get much more expressivity.

RIP macro_rules stack machine.

In order to design the thing correctly I also tried to make everything
copy: #146 to maintain
backwards compat with omitting &.

In the end I didn't really use that but instead just allowed you to pass
a reference to most of the functions in op.
@nickfarrow
Copy link
Collaborator

Changes look great to me, looked at FROST changes specifically and skimmed most of the other code (though i'm lacking skills to to review the macros themselves yet)

@LLFourn LLFourn force-pushed the proc_macro_arithmetic branch 6 times, most recently from e19bbd0 to fdf6924 Compare October 6, 2023 01:31
@LLFourn LLFourn merged commit 2467ece into master Jan 3, 2024
15 checks passed
@LLFourn LLFourn deleted the proc_macro_arithmetic branch January 3, 2024 05:41
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.

Make everyghing Copy Make API of op::lincomb not require collecting first
2 participants