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

Remove type hierarchy in the SSA #1966

Closed
sirasistant opened this issue Jul 19, 2023 · 2 comments
Closed

Remove type hierarchy in the SSA #1966

sirasistant opened this issue Jul 19, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@sirasistant
Copy link
Contributor

Problem

Right now in SSA arrays are a subtype of slice. Handling type hierarchy in SSA & codegen makes passes on the code more complicated, so we've decided to remove it keeping type hierarchy in the frontend.

Happy Case

There is only the Slice type in the SSA and we keep track of the length for ACIR execution.

Alternatives Considered

Removing type hierarchy in the frontend (arrays would require an operator or a method call to be converted to slices). This could create worse devex.

Additional Context

No response

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@sirasistant
Copy link
Contributor Author

Closing as a duplicate of #1963

@sirasistant sirasistant closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 19, 2023
@jfecher
Copy link
Contributor

jfecher commented Jul 19, 2023

I was going to re-open this because #1963 is only about changes to the type system not the SSA but maybe it does fix it in a way I haven't considered before. If functions were polymorphic over whether they took arrays or slices then we'd monomorphize a new version of the function for each. So there wouldn't be any functions after monomorphization that accepted both.

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