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: Parser and formatter support for enums #7110

Merged
merged 7 commits into from
Jan 17, 2025
Merged

feat: Parser and formatter support for enums #7110

merged 7 commits into from
Jan 17, 2025

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jan 17, 2025

Description

Problem*

Step towards #988

Summary*

Adds parser & formatter support for enumerations. Elaboration & comptime support is left as a todo!().

Additional Context

Enums are currently gated behind an experimental feature:

warning: Enums are experimental and aren't fully supported yet
  ┌─ src/main.nr:3:1
  │
3 │ enum Foo {
  │ ----
  │

Although they're behind a todo!(), it won't panic the compiler since they're elaborated to begin with.

Documentation*

Check one:

  • No documentation needed.
  • Documentation included in this PR.
  • [For Experimental Features] Documentation to be submitted in a separate PR.
    • Waiting until the feature is finished

PR Checklist*

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

@jfecher jfecher requested a review from a team January 17, 2025 18:00
Copy link
Contributor

github-actions bot commented Jan 17, 2025

Compilation Report

Program Compilation Time %
sha256_regression 1.010s -3%
regression_4709 0.795s 0%
ram_blowup_regression 16.300s 0%
rollup-root 3.512s -4%
rollup-merge 1.996s -6%
rollup-block-root-single-tx 143.000s -3%
rollup-block-root-empty 2.058s -4%
rollup-block-root 138.000s -9%
rollup-block-merge 3.604s -1%
rollup-base-public 28.420s 2%
rollup-base-private 10.900s 8%
private-kernel-tail 1.066s 7%
private-kernel-reset 6.048s 0%
private-kernel-inner 1.998s -1%

Copy link
Contributor

github-actions bot commented Jan 17, 2025

Execution Report

Program Execution Time %
sha256_regression 0.053s 0%
regression_4709 0.001s 0%
ram_blowup_regression 0.599s -1%
rollup-root 0.104s -4%
rollup-merge 0.007s 0%
rollup-block-root 38.100s -1%
rollup-block-merge 0.104s 0%
rollup-base-public 1.226s 0%
rollup-base-private 0.457s 1%
private-kernel-tail 0.020s 0%
private-kernel-reset 0.323s 4%
private-kernel-inner 0.068s 0%

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 'Compilation Time'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.10.

Benchmark suite Current: 6ebbec6 Previous: 82cb900 Ratio
rollup-base-public 30.94 s 27.64 s 1.12
private-kernel-inner 2.236 s 2.002 s 1.12

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

CC: @TomAFrench

Copy link
Contributor

github-actions bot commented Jan 17, 2025

Execution Memory Report

Program Peak Memory
keccak256 74.630
workspace 123.870
regression_4709 315.940
ram_blowup_regression 512.570
rollup-root 498.700
rollup-merge 473.340
rollup-block-root 1230.000
rollup-block-merge 498.710
rollup-base-public 734.390
rollup-base-private 590.810
private-kernel-tail 180.840
private-kernel-reset 245.440
private-kernel-inner 208.850

Copy link
Contributor

github-actions bot commented Jan 17, 2025

Compilation Memory Report

Program Peak Memory
keccak256 77.560
workspace 123.740
regression_4709 424.070
ram_blowup_regression 1460.000
rollup-root 601.600
rollup-merge 494.440
rollup-block-root-single-tx 16060.000
rollup-block-root-empty 489.060
rollup-block-root 16070.000
rollup-block-merge 601.590
rollup-base-public 2380.000
rollup-base-private 1140.000
private-kernel-tail 207.350
private-kernel-reset 584.400
private-kernel-inner 294.600

@jfecher
Copy link
Contributor Author

jfecher commented Jan 17, 2025

Performance Alert
rollup-block-root-single-tx 152 s 138 s

Does seem like a large difference for a PR which shouldn't impact anything

Copy link
Collaborator

@asterite asterite left a comment

Choose a reason for hiding this comment

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

It's happening! 🤩

@jfecher jfecher enabled auto-merge January 17, 2025 19:04
@asterite
Copy link
Collaborator

Hm, seeing that huge difference, maybe allowing enum Foo; is good then.

Just kidding, there's probably something wrong in CI? The compilation time change would also be explained by that.

@vezenovm
Copy link
Contributor

vezenovm commented Jan 17, 2025

Hm, seeing that huge difference, maybe allowing enum Foo; is good then.

Just kidding, there's probably something wrong in CI? The compilation time change would also be explained by that.

Globals brought a +2 overhead to all programs without globals. Probably just need to sync with master, as programs with globals would regress.

@jfecher jfecher added this pull request to the merge queue Jan 17, 2025
Merged via the queue into master with commit 7705a62 Jan 17, 2025
99 checks passed
@jfecher jfecher deleted the jf/enum-syntax branch January 17, 2025 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants