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

feat(experimental): Implement enum tag constants #7183

Merged
merged 34 commits into from
Jan 31, 2025
Merged

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jan 24, 2025

Description

Problem*

Resolves #7172

Summary*

Allows you to create enum constants like Option::None without calling them like a function Option::None()

Additional Context

This PR is currently blocked by #7182 since we translate all globals into comptime values, and enums are not yet implemented in comptime code. Just getting this PR out now so I don't forget about this branch.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

jfecher and others added 30 commits January 17, 2025 15:18
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Test Suite Duration'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.20.

Benchmark suite Current: 1b88e84 Previous: 8d39337 Ratio
noir-lang_schnorr_ 1 s 0 s +∞
noir-lang_noir_base64_ 2 s 1 s 2
noir-lang_eddsa_ 2 s 1 s 2
AztecProtocol_aztec-packages_noir-projects_noir-protocol-circuits_crates_parity-lib 4 s 3 s 1.33

This comment was automatically generated by workflow using github-action-benchmark.

CC: @TomAFrench

@jfecher jfecher marked this pull request as ready for review January 31, 2025 14:49
@jfecher
Copy link
Contributor Author

jfecher commented Jan 31, 2025

This PR is ready for review now

@jfecher jfecher requested a review from a team January 31, 2025 14:50
@jfecher jfecher added this pull request to the merge queue Jan 31, 2025
Merged via the queue into master with commit 0c6c637 Jan 31, 2025
101 checks passed
@jfecher jfecher deleted the jf/enum-constants branch January 31, 2025 16:22
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 1, 2025
…ir#7257)

feat(experimental): Implement enum tag constants (noir-lang/noir#7183)
fix(unrolling): Fetch original bytecode size from the original function (noir-lang/noir#7253)
fix(ssa): Use number of SSA instructions for the Brillig unrolling bytecode size limit (noir-lang/noir#7242)
feat: Sync from aztec-packages (noir-lang/noir#7241)
chore: bump gates diff (noir-lang/noir#7245)
feat: simplify subtraction from self to return zero (noir-lang/noir#7189)
feat: allow specifying multiple patterns in nargo test (noir-lang/noir#7186)
fix: Avoid type error when calling something with a type alias of a function (noir-lang/noir#7239)
feat: Allow resolved types in constructors (noir-lang/noir#7223)
chore: clarify to_radix docs examples (noir-lang/noir#7230)
chore: fix struct example (noir-lang/noir#7198)
feat(optimization): Add purity analysis to SSA (noir-lang/noir#7197)
chore: start tracking time to run critical library tests (noir-lang/noir#7221)
chore: Rework defunctionalize pass to not rely on DFG bugs (noir-lang/noir#7222)
fix(brillig): Globals entry point reachability analysis  (noir-lang/noir#7188)
chore: update docs to use devcontainer feature (noir-lang/noir#7206)
chore(ci): Add test for global vars entry points regression (noir-lang/noir#7209)
chore(ssa): Flip the SSA Brillig constraint check to off by default (noir-lang/noir#7211)
chore(docs): moving references to noir-starter to awesome-noir (noir-lang/noir#7203)
chore: build docs in the merge queue (noir-lang/noir#7218)
fix: correct reversed callstacks (noir-lang/noir#7212)
chore: exclude dependency fetching time from benchmarks (noir-lang/noir#7210)
feat(experimental): Support enums in comptime code (noir-lang/noir#7194)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 1, 2025
feat(experimental): Implement enum tag constants (noir-lang/noir#7183)
fix(unrolling): Fetch original bytecode size from the original function (noir-lang/noir#7253)
fix(ssa): Use number of SSA instructions for the Brillig unrolling bytecode size limit (noir-lang/noir#7242)
feat: Sync from aztec-packages (noir-lang/noir#7241)
chore: bump gates diff (noir-lang/noir#7245)
feat: simplify subtraction from self to return zero (noir-lang/noir#7189)
feat: allow specifying multiple patterns in nargo test (noir-lang/noir#7186)
fix: Avoid type error when calling something with a type alias of a function (noir-lang/noir#7239)
feat: Allow resolved types in constructors (noir-lang/noir#7223)
chore: clarify to_radix docs examples (noir-lang/noir#7230)
chore: fix struct example (noir-lang/noir#7198)
feat(optimization): Add purity analysis to SSA (noir-lang/noir#7197)
chore: start tracking time to run critical library tests (noir-lang/noir#7221)
chore: Rework defunctionalize pass to not rely on DFG bugs (noir-lang/noir#7222)
fix(brillig): Globals entry point reachability analysis  (noir-lang/noir#7188)
chore: update docs to use devcontainer feature (noir-lang/noir#7206)
chore(ci): Add test for global vars entry points regression (noir-lang/noir#7209)
chore(ssa): Flip the SSA Brillig constraint check to off by default (noir-lang/noir#7211)
chore(docs): moving references to noir-starter to awesome-noir (noir-lang/noir#7203)
chore: build docs in the merge queue (noir-lang/noir#7218)
fix: correct reversed callstacks (noir-lang/noir#7212)
chore: exclude dependency fetching time from benchmarks (noir-lang/noir#7210)
feat(experimental): Support enums in comptime code (noir-lang/noir#7194)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 2, 2025
…ir#7257)

feat(experimental): Implement enum tag constants (noir-lang/noir#7183)
fix(unrolling): Fetch original bytecode size from the original function (noir-lang/noir#7253)
fix(ssa): Use number of SSA instructions for the Brillig unrolling bytecode size limit (noir-lang/noir#7242)
feat: Sync from aztec-packages (noir-lang/noir#7241)
chore: bump gates diff (noir-lang/noir#7245)
feat: simplify subtraction from self to return zero (noir-lang/noir#7189)
feat: allow specifying multiple patterns in nargo test (noir-lang/noir#7186)
fix: Avoid type error when calling something with a type alias of a function (noir-lang/noir#7239)
feat: Allow resolved types in constructors (noir-lang/noir#7223)
chore: clarify to_radix docs examples (noir-lang/noir#7230)
chore: fix struct example (noir-lang/noir#7198)
feat(optimization): Add purity analysis to SSA (noir-lang/noir#7197)
chore: start tracking time to run critical library tests (noir-lang/noir#7221)
chore: Rework defunctionalize pass to not rely on DFG bugs (noir-lang/noir#7222)
fix(brillig): Globals entry point reachability analysis  (noir-lang/noir#7188)
chore: update docs to use devcontainer feature (noir-lang/noir#7206)
chore(ci): Add test for global vars entry points regression (noir-lang/noir#7209)
chore(ssa): Flip the SSA Brillig constraint check to off by default (noir-lang/noir#7211)
chore(docs): moving references to noir-starter to awesome-noir (noir-lang/noir#7203)
chore: build docs in the merge queue (noir-lang/noir#7218)
fix: correct reversed callstacks (noir-lang/noir#7212)
chore: exclude dependency fetching time from benchmarks (noir-lang/noir#7210)
feat(experimental): Support enums in comptime code (noir-lang/noir#7194)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Feb 2, 2025
feat(experimental): Implement enum tag constants (noir-lang/noir#7183)
fix(unrolling): Fetch original bytecode size from the original function (noir-lang/noir#7253)
fix(ssa): Use number of SSA instructions for the Brillig unrolling bytecode size limit (noir-lang/noir#7242)
feat: Sync from aztec-packages (noir-lang/noir#7241)
chore: bump gates diff (noir-lang/noir#7245)
feat: simplify subtraction from self to return zero (noir-lang/noir#7189)
feat: allow specifying multiple patterns in nargo test (noir-lang/noir#7186)
fix: Avoid type error when calling something with a type alias of a function (noir-lang/noir#7239)
feat: Allow resolved types in constructors (noir-lang/noir#7223)
chore: clarify to_radix docs examples (noir-lang/noir#7230)
chore: fix struct example (noir-lang/noir#7198)
feat(optimization): Add purity analysis to SSA (noir-lang/noir#7197)
chore: start tracking time to run critical library tests (noir-lang/noir#7221)
chore: Rework defunctionalize pass to not rely on DFG bugs (noir-lang/noir#7222)
fix(brillig): Globals entry point reachability analysis  (noir-lang/noir#7188)
chore: update docs to use devcontainer feature (noir-lang/noir#7206)
chore(ci): Add test for global vars entry points regression (noir-lang/noir#7209)
chore(ssa): Flip the SSA Brillig constraint check to off by default (noir-lang/noir#7211)
chore(docs): moving references to noir-starter to awesome-noir (noir-lang/noir#7203)
chore: build docs in the merge queue (noir-lang/noir#7218)
fix: correct reversed callstacks (noir-lang/noir#7212)
chore: exclude dependency fetching time from benchmarks (noir-lang/noir#7210)
feat(experimental): Support enums in comptime code (noir-lang/noir#7194)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum variants with no fields must still be called like functions
3 participants