-
Notifications
You must be signed in to change notification settings - Fork 219
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
feat(ssa_refactor)!: Add Slices #1728
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally this looks very good. I do have some mostly frontend-related suggestions.
- I see why we need this
enable_slices
flag. I was contemplating asking for a different syntax for slices until the new ssa becomes the default so that they can be separated from the previous deprecated slice syntax. I think now though we should just make an issue for removingenable_slices
(or one for removing the old ssa ir and mention to remove enable_slices as well) and call it a day. - Can we remove
Type::Vec
as well? It is unused and we have different plans for implementing Vecs now so they won't need to be a primitive type anymore.
Co-authored-by: jfecher <jake@aztecprotocol.com>
…ec using mutable refs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Problem*
Resolves #582 and #1736
Works towards resolving issue #1556. This comment has more information on how we will add slices and Vectors into Noir: #1556 (comment).
Summary*
This PR adds syntax to enable slices (arrays without a known size during compilation). A slice's size is implicitly tracked during SSA and is represented as an array under the hood. Array syntax will remain the same but any types such as
[Field]
will be replaced by the new slices. Support is only included in the new SSA pass, thus some tech debt was included to conditionally handle slice vs. array compilation in the frontend.Documentation
This PR requires documentation updates when merged.
Additional Context
PR Checklist*
cargo fmt
on default settings.