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

Compile time operations on comptime variables #1853

Closed
curryrasul opened this issue Jul 4, 2023 · 1 comment
Closed

Compile time operations on comptime variables #1853

curryrasul opened this issue Jul 4, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@curryrasul
Copy link

curryrasul commented Jul 4, 2023

Problem

I was working on a custom Merkle tree circuit, and I parameterized it with const/comptime generic DEPTH.
However one component/variable had to be an array of DEPTH + 1 elements. So it seems like constant operations are not supported.

Happy Case

global A: Field = 1;
global B: Field = 1;

global C: Field = A + B; // C = 2, processed during compile-time

or

global C: Field = 1 + 1; // C = 2, processed during compile-time

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@curryrasul curryrasul added the enhancement New feature or request label Jul 4, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jul 4, 2023
@TomAFrench
Copy link
Member

This is a duplicate of #1734 which goes into some detail on why we currently don't have this. (I agree that we should support this in future however)

@TomAFrench TomAFrench closed this as not planned Won't fix, can't repro, duplicate, stale Jul 4, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

No branches or pull requests

2 participants