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: Run comptime code from annotations on a type definition #5256

Merged
merged 46 commits into from
Jun 18, 2024

Conversation

jfecher
Copy link
Contributor

@jfecher jfecher commented Jun 14, 2024

Description

Problem*

Resolves #5255

Summary*

Implements the ability to run comptime code when an annotation is put on a type definition. This annotation must resolve to a comptime function in scope, which is then called with the type definition as an argument. There are currently no API functions to actually do anything with a TypeDefinition object. The plan is to add functions in the future to inspect or add fields & generics.

#[print_type]
struct Foo {
    bar: Field,
}

comptime fn print_type(typ: TypeDefinition) {
    println("hello from print_type_name at compile-time");
    println(typ); // only prints "(type definition)" currently
}

fn main(){}

Additional Context

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 3 commits June 18, 2024 12:20
…el definitions and types (#5267)

# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

## Summary\*

Adds a `TopLevelItem` and `Type` keywords & types for quoting type
definitions, functions, trait impls, etc. and types respectively. The
former is needed to identify items which can be unquoted at the
top-level of a file - e.g. to prevent random expressions from being
unquoted at the top level and to prevent trait impls from being unquoted
in the middle of a function.

## Additional Context

There is no way currently to create a TopLevelItem. The intended method
is to be able to specify the type you want to quote in a quote
expression: `quote TopLevelItem { ... }` but our current parser makes
this very difficult since the top level statement parser would need to
become recursive and be passed down through each function. For now I'm
planning to have compiler API function's as a work around - e.g:

```rs
impl TopLevelItem {
    #[builtin(new_trait_impl)]
    pub fn new_trait_impl(generics: Vec<String>, trait: Type, typ: Type, methods: Vec<TopLevelItem>) -> TopLevelItem { }
}
```

## Documentation\*

Check one:
- [ ] No documentation needed.
- [ ] Documentation included in this PR.
- [x] **[For Experimental Features]** Documentation to be submitted in a
separate PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@jfecher jfecher enabled auto-merge June 18, 2024 17:20
@jfecher jfecher added this pull request to the merge queue Jun 18, 2024
Merged via the queue into master with commit 6cbe6a0 Jun 18, 2024
43 checks passed
@jfecher jfecher deleted the jf/annotations branch June 18, 2024 17:41
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 19, 2024
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
TomAFrench added a commit that referenced this pull request Jun 19, 2024
* master: (67 commits)
  chore: Pedersen commitment in Noir (#5221)
  chore: pedersen hash in Noir (#5217)
  fix: Don't lazily elaborate functions (#5282)
  fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (#5291)
  fix: avoid duplicating constant arrays (#5287)
  feat: add fuzzer for Noir programs (#5251)
  feat: Run `comptime` code from annotations on a type definition (#5256)
  feat: implement comptime support for `as_slice` builtin (#5276)
  chore: create separate crate just for noir artifacts (#5162)
  feat: add support for wildcard types (#5275)
  chore: replace logical operators with bitwise in `DebugToString` (#5236)
  fix: use proper serialization in `AbiValue` (#5270)
  chore: simplify compilation flow to write to file immediately (#5265)
  feat: implement comptime support for `array_len` builtin (#5272)
  chore: Use the elaborator by default (#5246)
  chore: Release Noir(0.31.0) (#5166)
  feat!: remove `dep::` prefix (#4946)
  feat: Sync from aztec-packages (#5242)
  chore: replace `is_bn254` implementation to not rely on truncation of literals (#5247)
  chore: add no-predicate to hash implementations (#5253)
  ...
TomAFrench added a commit that referenced this pull request Jun 19, 2024
* master: (34 commits)
  chore: Pedersen commitment in Noir (#5221)
  chore: pedersen hash in Noir (#5217)
  fix: Don't lazily elaborate functions (#5282)
  fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (#5291)
  fix: avoid duplicating constant arrays (#5287)
  feat: add fuzzer for Noir programs (#5251)
  feat: Run `comptime` code from annotations on a type definition (#5256)
  feat: implement comptime support for `as_slice` builtin (#5276)
  chore: create separate crate just for noir artifacts (#5162)
  feat: add support for wildcard types (#5275)
  chore: replace logical operators with bitwise in `DebugToString` (#5236)
  fix: use proper serialization in `AbiValue` (#5270)
  chore: simplify compilation flow to write to file immediately (#5265)
  feat: implement comptime support for `array_len` builtin (#5272)
  chore: Use the elaborator by default (#5246)
  chore: Release Noir(0.31.0) (#5166)
  feat!: remove `dep::` prefix (#4946)
  feat: Sync from aztec-packages (#5242)
  chore: replace `is_bn254` implementation to not rely on truncation of literals (#5247)
  chore: add no-predicate to hash implementations (#5253)
  ...
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 20, 2024
…lues (noir-lang/noir#5244)

feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 20, 2024
…lues (noir-lang/noir#5244)

feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 20, 2024
…nctions `modulus_be_bytes()`, `modulus_be_bits()`, etc. (noir-lang/noir#5278)

chore: refactor test case generation in build.rs (noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values (noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
TomAFrench added a commit that referenced this pull request Jun 20, 2024
* master: (57 commits)
  fix: fix incorrect return type being applied to stdlib functions `modulus_be_bytes()`, `modulus_be_bits()`, etc. (#5278)
  chore: refactor test case generation in build.rs (#5280)
  fix: handle struct with nested arrays in oracle return values (#5244)
  feat: build simple dictionary from inspecting ACIR program (#5264)
  fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (#5009)
  chore: Pedersen commitment in Noir (#5221)
  chore: pedersen hash in Noir (#5217)
  fix: Don't lazily elaborate functions (#5282)
  fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (#5291)
  fix: avoid duplicating constant arrays (#5287)
  feat: add fuzzer for Noir programs (#5251)
  feat: Run `comptime` code from annotations on a type definition (#5256)
  feat: implement comptime support for `as_slice` builtin (#5276)
  chore: create separate crate just for noir artifacts (#5162)
  feat: add support for wildcard types (#5275)
  chore: replace logical operators with bitwise in `DebugToString` (#5236)
  fix: use proper serialization in `AbiValue` (#5270)
  chore: simplify compilation flow to write to file immediately (#5265)
  feat: implement comptime support for `array_len` builtin (#5272)
  chore: Use the elaborator by default (#5246)
  ...
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 20, 2024
…etadata in elaborator (noir-lang/noir#5292)

fix: fix incorrect return type being applied to stdlib functions `modulus_be_bytes()`, `modulus_be_bits()`, etc. (noir-lang/noir#5278)
chore: refactor test case generation in build.rs (noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values (noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 21, 2024
…t of a function (noir-lang/noir#5303)

fix: update `in_contract` flag before handling function metadata in elaborator (noir-lang/noir#5292)
fix: fix incorrect return type being applied to stdlib functions `modulus_be_bytes()`, `modulus_be_bits()`, etc. (noir-lang/noir#5278)
chore: refactor test case generation in build.rs (noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values (noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 24, 2024
…21) (noir-lang/noir#5318)

fix: skip emission of brillig calls which will never be executed (noir-lang/noir#5314)
feat: Make macros operate on token streams instead of AST nodes (noir-lang/noir#5301)
chore: Bundle SSA Evaluator Options (noir-lang/noir#5317)
fix: Replace panic in monomorphization with an error (noir-lang/noir#5305)
fix(nargo_fmt): Account for spaces before the generic list of a function (noir-lang/noir#5303)
fix: update `in_contract` flag before handling function metadata in elaborator (noir-lang/noir#5292)
fix: fix incorrect return type being applied to stdlib functions `modulus_be_bytes()`, `modulus_be_bits()`, etc. (noir-lang/noir#5278)
chore: refactor test case generation in build.rs (noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values (noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
AztecBot added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 24, 2024
…21) (noir-lang/noir#5318)

fix: skip emission of brillig calls which will never be executed (noir-lang/noir#5314)
feat: Make macros operate on token streams instead of AST nodes (noir-lang/noir#5301)
chore: Bundle SSA Evaluator Options (noir-lang/noir#5317)
fix: Replace panic in monomorphization with an error (noir-lang/noir#5305)
fix(nargo_fmt): Account for spaces before the generic list of a function (noir-lang/noir#5303)
fix: update `in_contract` flag before handling function metadata in elaborator (noir-lang/noir#5292)
fix: fix incorrect return type being applied to stdlib functions `modulus_be_bytes()`, `modulus_be_bits()`, etc. (noir-lang/noir#5278)
chore: refactor test case generation in build.rs (noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values (noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program (noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it from constrained code to unconstrained code (noir-lang/noir#5009)
chore: Pedersen commitment in Noir (noir-lang/noir#5221)
chore: pedersen hash in Noir (noir-lang/noir#5217)
fix: Don't lazily elaborate functions (noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays (noir-lang/noir#5287)
feat: add fuzzer for Noir programs (noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition (noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin (noir-lang/noir#5276)
chore: create separate crate just for noir artifacts (noir-lang/noir#5162)
feat: add support for wildcard types (noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString` (noir-lang/noir#5236)
fix: use proper serialization in `AbiValue` (noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately (noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin (noir-lang/noir#5272)
chore: Use the elaborator by default (noir-lang/noir#5246)
chore: Release Noir(0.31.0) (noir-lang/noir#5166)
feat!: remove `dep::` prefix (noir-lang/noir#4946)
feat: Sync from aztec-packages (noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations (noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values (noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2 (noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec` (noir-lang/noir#5241)
fix: Disable `if` optimization (noir-lang/noir#5240)
chore: redo typo PR by dropbigfish (noir-lang/noir#5234)
chore: add property tests for ABI encoding (noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen (noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages (noir-lang/noir#5235)
chore(docs): fixing trailing slash issue (noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles (noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator (noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes (noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error (noir-lang/noir#5225)
chore: fixing all relative paths (noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver` (noir-lang/noir#5218)
TomAFrench added a commit to AztecProtocol/aztec-packages that referenced this pull request Jun 27, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: add back Pedersen blackbox functions (revert PR 5221)
(noir-lang/noir#5318)
fix: skip emission of brillig calls which will never be executed
(noir-lang/noir#5314)
feat: Make macros operate on token streams instead of AST nodes
(noir-lang/noir#5301)
chore: Bundle SSA Evaluator Options
(noir-lang/noir#5317)
fix: Replace panic in monomorphization with an error
(noir-lang/noir#5305)
fix(nargo_fmt): Account for spaces before the generic list of a function
(noir-lang/noir#5303)
fix: update `in_contract` flag before handling function metadata in
elaborator (noir-lang/noir#5292)
fix: fix incorrect return type being applied to stdlib functions
`modulus_be_bytes()`, `modulus_be_bits()`, etc.
(noir-lang/noir#5278)
chore: refactor test case generation in build.rs
(noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values
(noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program
(noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it
from constrained code to unconstrained code
(noir-lang/noir#5009)
chore: Pedersen commitment in Noir
(noir-lang/noir#5221)
chore: pedersen hash in Noir
(noir-lang/noir#5217)
fix: Don't lazily elaborate functions
(noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms
with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays
(noir-lang/noir#5287)
feat: add fuzzer for Noir programs
(noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition
(noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin
(noir-lang/noir#5276)
chore: create separate crate just for noir artifacts
(noir-lang/noir#5162)
feat: add support for wildcard types
(noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString`
(noir-lang/noir#5236)
fix: use proper serialization in `AbiValue`
(noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately
(noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin
(noir-lang/noir#5272)
chore: Use the elaborator by default
(noir-lang/noir#5246)
chore: Release Noir(0.31.0)
(noir-lang/noir#5166)
feat!: remove `dep::` prefix
(noir-lang/noir#4946)
feat: Sync from aztec-packages
(noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of
literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations
(noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values
(noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2
(noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec`
(noir-lang/noir#5241)
fix: Disable `if` optimization
(noir-lang/noir#5240)
chore: redo typo PR by dropbigfish
(noir-lang/noir#5234)
chore: add property tests for ABI encoding
(noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen
(noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages
(noir-lang/noir#5235)
chore(docs): fixing trailing slash issue
(noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles
(noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator
(noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes
(noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error
(noir-lang/noir#5225)
chore: fixing all relative paths
(noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver`
(noir-lang/noir#5218)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: TomAFrench <tom@tomfren.ch>
AztecBot added a commit to AztecProtocol/aztec-nr that referenced this pull request Jun 28, 2024
Automated pull of development from the
[noir](https://github.com/noir-lang/noir) programming language, a
dependency of Aztec.
BEGIN_COMMIT_OVERRIDE
chore: add back Pedersen blackbox functions (revert PR 5221)
(noir-lang/noir#5318)
fix: skip emission of brillig calls which will never be executed
(noir-lang/noir#5314)
feat: Make macros operate on token streams instead of AST nodes
(noir-lang/noir#5301)
chore: Bundle SSA Evaluator Options
(noir-lang/noir#5317)
fix: Replace panic in monomorphization with an error
(noir-lang/noir#5305)
fix(nargo_fmt): Account for spaces before the generic list of a function
(noir-lang/noir#5303)
fix: update `in_contract` flag before handling function metadata in
elaborator (noir-lang/noir#5292)
fix: fix incorrect return type being applied to stdlib functions
`modulus_be_bytes()`, `modulus_be_bits()`, etc.
(noir-lang/noir#5278)
chore: refactor test case generation in build.rs
(noir-lang/noir#5280)
fix: handle struct with nested arrays in oracle return values
(noir-lang/noir#5244)
feat: build simple dictionary from inspecting ACIR program
(noir-lang/noir#5264)
fix: Add more thorough check for whether a type is valid when passing it
from constrained code to unconstrained code
(noir-lang/noir#5009)
chore: Pedersen commitment in Noir
(noir-lang/noir#5221)
chore: pedersen hash in Noir
(noir-lang/noir#5217)
fix: Don't lazily elaborate functions
(noir-lang/noir#5282)
fix: avoid unnecessarily splitting expressions with multiplication terms
with a shared term (noir-lang/noir#5291)
fix: avoid duplicating constant arrays
(noir-lang/noir#5287)
feat: add fuzzer for Noir programs
(noir-lang/noir#5251)
feat: Run `comptime` code from annotations on a type definition
(noir-lang/noir#5256)
feat: implement comptime support for `as_slice` builtin
(noir-lang/noir#5276)
chore: create separate crate just for noir artifacts
(noir-lang/noir#5162)
feat: add support for wildcard types
(noir-lang/noir#5275)
chore: replace logical operators with bitwise in `DebugToString`
(noir-lang/noir#5236)
fix: use proper serialization in `AbiValue`
(noir-lang/noir#5270)
chore: simplify compilation flow to write to file immediately
(noir-lang/noir#5265)
feat: implement comptime support for `array_len` builtin
(noir-lang/noir#5272)
chore: Use the elaborator by default
(noir-lang/noir#5246)
chore: Release Noir(0.31.0)
(noir-lang/noir#5166)
feat!: remove `dep::` prefix
(noir-lang/noir#4946)
feat: Sync from aztec-packages
(noir-lang/noir#5242)
chore: replace `is_bn254` implementation to not rely on truncation of
literals (noir-lang/noir#5247)
chore: add no-predicate to hash implementations
(noir-lang/noir#5253)
feat(experimental): Implement macro calls & splicing into `Expr` values
(noir-lang/noir#5203)
feat: add BoundedVec::map (noir-lang/noir#5250)
chore: add no predicate to poseidon2
(noir-lang/noir#5252)
feat: add `set` and `set_unchecked` methods to `Vec` and `BoundedVec`
(noir-lang/noir#5241)
fix: Disable `if` optimization
(noir-lang/noir#5240)
chore: redo typo PR by dropbigfish
(noir-lang/noir#5234)
chore: add property tests for ABI encoding
(noir-lang/noir#5216)
chore: thread generics through ACIR/brillig gen
(noir-lang/noir#5120)
chore: copy across typo PR script from aztec-packages
(noir-lang/noir#5235)
chore(docs): fixing trailing slash issue
(noir-lang/noir#5233)
fix: add support for nested arrays returned by oracles
(noir-lang/noir#5132)
chore: Parse macros (noir-lang/noir#5229)
chore: Optimize the elaborator
(noir-lang/noir#5230)
fix(elaborator): Fix regression introduced by lazy-global changes
(noir-lang/noir#5223)
fix(elaborator): Fix duplicate methods error
(noir-lang/noir#5225)
chore: fixing all relative paths
(noir-lang/noir#5220)
chore: push code related to ABI gen into `noirc_driver`
(noir-lang/noir#5218)
END_COMMIT_OVERRIDE

---------

Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Co-authored-by: TomAFrench <tom@tomfren.ch>
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.

Run comptime code when a type definition is annotated with a comptime function
2 participants