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

Add partial evaluator #461

Closed
jfecher opened this issue Nov 10, 2022 · 2 comments
Closed

Add partial evaluator #461

jfecher opened this issue Nov 10, 2022 · 2 comments
Labels
enhancement New feature or request refactor

Comments

@jfecher
Copy link
Contributor

jfecher commented Nov 10, 2022

Problem

As noir grows we naturally want to add more and more comptime features to it, yet arbitrary features can be difficult to add to the SSA pass and it seems unnecessary to have SSA manage all these extra features which should always be removed at compile-time.

Solution

If we added a partial-evaluation pass to inline functions/loops before SSA and evaluate comptime expressions then it would make several features easier to add in the future: expanding comptime expressions, the mini-evaluator in the name resolver can be removed, and for-loops returning arrays can be implemented.

Alternatives considered

Alternatively, we can add these features all to SSA and deal with them there. Depending on the feature this may be more difficult to add.

@jfecher jfecher added the enhancement New feature or request label Nov 10, 2022
@kevaundray
Copy link
Contributor

Please add a refactoring label and remove refactoring from the title

@jfecher jfecher changed the title [Refactoring] Add partial evaluator Add partial evaluator Jan 23, 2023
@jfecher
Copy link
Contributor Author

jfecher commented Jun 16, 2023

Closing this issue. We've experimented with a partial evaluator somewhat but have elected to keep comptime evaluation in SSA which can better evaluate across functions during inlining.

@jfecher jfecher closed this as completed Jun 16, 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 refactor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants