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

Epic: More modular frontend #6569

Open
10 tasks
michaeljklein opened this issue Nov 20, 2024 · 1 comment
Open
10 tasks

Epic: More modular frontend #6569

michaeljklein opened this issue Nov 20, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@michaeljklein
Copy link
Contributor

Problem

The frontend could be split into more modular parts by reducing repetition, grouping some Type variants by their behavior, and splitting out some code into separate crates

Happy Case

Reduce repetition

  • Use NodeInterner and Type impl helper functions (these functions are sometimes inlined)
  • Use the same field names in the AST and HIR, e.g. bounds in NoirTrait vs. trait_bounds in Trait
  • Use helper functions for hir_def fields and make them private, e.g. set_methods for Trait, or else consider removing those helper functions

Grouping types by behavior

Each of the types in these groups shares methods, e.g. the sized container types all evaluate their lengths to u32's, struct and tuple types both require iteration over their fields, etc.

  • Sized container types:
    • [T; N]
    • str<N>
    • fmtstr<N, T>
  • Struct + Tuple
  • Integral types:
    • Field
    • bool
    • ()?
  • Arithmetic generics:
    • InfixExpr
    • CheckedCast
    • Constant
  • Type variables:
    • TypeVariable
    • NamedGeneric

Separate crates

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

Nice-to-have

Blocker Context

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

@michaeljklein michaeljklein added the enhancement New feature or request label Nov 20, 2024
@michaeljklein michaeljklein self-assigned this Nov 20, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Nov 20, 2024
@michaeljklein
Copy link
Contributor Author

michaeljklein commented Nov 20, 2024

@TomAFrench

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
Status: 📋 Backlog
Development

No branches or pull requests

1 participant