Skip to content

Commit

Permalink
chore: aztec-macros refactor (AztecProtocol/aztec-packages#5127)
Browse files Browse the repository at this point in the history
Partially addresses
AztecProtocol/aztec-packages#5080

Until we have full macro support in noir, this PR aims to make using
what we currently have a little bit less painful.
The crate is now divided into utils of several kind (ast manipulation,
error handling, hir manipulation...) and transforms.

A transform is an end-to-end modification to the noir code that
generates a valid compilation result from a given contract. This makes
it easier to manipulate (and hopefully soon, replace) said modifications
atomically, improving readability.

This also modifies the first macro pass to iterate over all crates, not
only the root one, which allows us to implement more stuff without
having to dig deep into the def collector or (god forbid) the interner.

The second macro pass has been renamed to `process_collected_defs`.
Tried to generalize it a bit more, but providing a mutable ref for the
whole `def_collector` turned out to be tricky without cloning
`def_maps`, so it's staying like it is now.
  • Loading branch information
AztecBot committed Mar 11, 2024
1 parent fe8f277 commit 2ccf3cd
Show file tree
Hide file tree
Showing 50 changed files with 2,381 additions and 1,832 deletions.
2 changes: 1 addition & 1 deletion .aztec-sync-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7ff9b71d8d87fc93ae7dbd8ba63f5176b0cd17be
2195441afde4d6e78ad0c6027d0a7dbc8671817d
20 changes: 20 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ members = [
"tooling/nargo_toml",
"tooling/noirc_abi",
"tooling/noirc_abi_wasm",
"tooling/acvm_cli",
# ACVM
"acvm-repo/acir_field",
"acvm-repo/acir",
Expand All @@ -36,7 +37,7 @@ members = [
"acvm-repo/blackbox_solver",
"acvm-repo/bn254_blackbox_solver",
]
default-members = ["tooling/nargo_cli"]
default-members = ["tooling/nargo_cli", "tooling/acvm_cli"]
resolver = "2"

[workspace.package]
Expand Down Expand Up @@ -78,6 +79,7 @@ noir_lsp = { path = "tooling/lsp" }
noir_debugger = { path = "tooling/debugger" }
noirc_abi = { path = "tooling/noirc_abi" }
bb_abstraction_leaks = { path = "tooling/bb_abstraction_leaks" }
acvm_cli = { path = "tooling/acvm_cli" }

# LSP
async-lsp = { version = "0.1.0", default-features = false }
Expand Down
Loading

0 comments on commit 2ccf3cd

Please sign in to comment.