-
Notifications
You must be signed in to change notification settings - Fork 204
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
[Tracking Issue]: Macro discussions, library transforming and long term goals #2419
Comments
Thanks for creating the issue! @kevaundray should we replace / merge issues in #1378 into this? |
Update: much of this has been implemented in Noir's new metaprogramming features here: #4594. Although implementing the full transformation for the |
After AztecProtocol/aztec-packages#8438, I think @Maddiaa0 you can do the honors and close this 😄 |
Problem
In recent discussions it was raised that noir will aim to support complex features that are required for smart contract languages. e,g, ways to support additions of syntactic sugar.
Why do we want this
It may be the case that teams (like aztec) would like to build
meta-frameworks
on top of noir. Much like in solana we have anchor lang which exists as a meta framework on top of rust.Anchor abstracts the guts of the solana api and creates a nice developer framework that protects developers from common footguns and makes the devex alot nicer.
A quick example for this syntax is shown below:
For example what originally was:
can instead be written as:
Custom annotations could be used (like macros) to transform the ast of functions and remove ugly and distracting boilerplate.
Short Term Goals (Hard deadline: completion by 15th September 2023)
Related Issues to the short term goals of this issue
Stretch goals support
serialize
anddeserialize
functions #2240aztec
functionsLong term goals
The long term goals associated with this issue have an arbitrary time horizon and should not be direct blockers for stakeholders. They are rather aligned with supporting noir's long term vision.
The following work is not captured outside of this issue as no formal spec has been decided on, it is included to spark discussions about solutions that can remove stakeholder specific feature flags living in the code base
Abilities
syntaxThis syntax comes out of a conversation between kev and jake over how to remove the trans-formative attributes introduced in #2403.
The overarching idea of the abilities syntax is that we can polyfill arguments and variables into a method. The best mental model I have come across when thinking about it is that it is a combination between creating a
facade
class to inject arguments and a soliditymodifier
to extend a functions ability.In the examples below, the with
aztec3
will make a context available, and include the aztec kernel circuit inputs as the first parameter. Similar to how the hacky macro syntax above works, but at a language level.Although nice solution, it will likely not exist in the short term due to its dependence on traits.
The text was updated successfully, but these errors were encountered: