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

Dynamic indices for non-homogenous array #2461

Closed
vezenovm opened this issue Aug 28, 2023 · 2 comments · Fixed by #2703
Closed

Dynamic indices for non-homogenous array #2461

vezenovm opened this issue Aug 28, 2023 · 2 comments · Fixed by #2703
Labels
acir-gen enhancement New feature or request

Comments

@vezenovm
Copy link
Contributor

Problem

Reference this unimplemented macro in ACIR gen (

"Non-const array indices is not implemented for non-homogenous array"
).

With the introduction of dynamic indices for slices as well in this PR (#2446) enabling dynamic indices for arrays of complex types is necessary to avoid inconsistencies in our array/slice implementations.

Happy Case

Non-const indices should be fully supported just like const indices for both arrays and slices.

Alternatives Considered

N/A, there is no reasonable alternative

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@Savio-Sou
Copy link
Collaborator

What does "non-homogenous array" here mean?

Aren't arrays in Noir strictly required to be homogeneous, as in all elements in a Noir array must be of the same type?

(Or is this referring to Rust arrays in ACIR?)

@vezenovm
Copy link
Contributor Author

"Non-homogenous array" means an array of structs basically, technically if we had a struct like such:

struct Bar {
    inner: [Field; 3],
}
struct Foo {
    a: Field,
    b: [Field; 3],
    bar: Bar,
}

and an array x : [Foo; 4] the array is homogenous for the Foo type. But we flatten structs into its internal type structure so it is in fact an array with the types Field, [Field; 3], [Field; 3], thus being non-homogenous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
acir-gen enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants